Giter Club home page Giter Club logo

prs1378 / presian-date-for-mysql Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zoghal/persiandate4mysql

0.0 0.0 0.0 20 KB

pDate is a Gregorian / Jalali(Shamsi) date convertor functions for MySQL 5.1+

Home Page: http://saleh.soozanchi.ir/1388/07/05/%D8%AA%D9%88%D8%A7%D8%A8%D8%B9-%D8%AA%D8%A7%D8%B1%DB%8C%D8%AE-%D8%B4%D9%85%D8%B3%DB%8C-%D8%AC%D9%87%D8%AA-%D8%A7%D8%B3%D8%AA%D9%81%D8%A7%D8%AF%D9%87-%D8%AF%D8%B1-mysql/

TSQL 100.00%

presian-date-for-mysql's Introduction

[MySQL] pDate

Content:

About

[MySQL] pDate is a Gregorian / Jalali date converter functions for MySQL.

Requirements

  • MySQL 5+

Download

Installation

Import pDate.sql in your database.

Usage

You can use these six functions, which are provided on a set:

PDATE(datetime)

Takes georgian datetime as input and returns jalali date in text format.

PMONTH(datetime)

Takes georgian datetime as input and returns jalali month number in text format.

PMONTHNAME(datetime)

Takes georgian datetime as input and returns jalali month name in text format.

PYEAR(datetime)

Takes georgian datetime as input and returns jalali year number in text format.

PDAY(datetime)

Takes georgian datetime as input and returns jalali day number in text format.

GDATE(year smallint, month smallint, day smallint)

Takes jalali date in "year/month/day" format as input and returns georgian date in datetime format.

GDATESTR(jdate char(10))

Takes jalali date in string format (e.g: '1390/3/3' or '1390/03/3' or '1390/3/03 or '1390/03/03' ) as input and returns georgian date in datetime format.

You can not enter Jalali year in short format! for example '90/03/03' shows the 90th Jalali year, not 1390!


Here is simple line of sql code which you can use it to test the set of functions:

SELECT	pdate(NOW()),
		pyear('2009-09-22'),
        pmonth('2009-09-22'),
        pmonthname(NOW()),
        gdate(1366,9,19),
        gdatestr('1366/9/19');

License

GNU General Public License. http://www.gnu.org/licenses/gpl.txt

Issues/Feedbacks

https://github.com/zoghal/Presian-Date-for-MySQL/issues

presian-date-for-mysql's People

Contributors

amnkh avatar mahmoud-eskandari avatar mehdi-hp avatar saeidzebardast avatar sallar avatar spitmaan avatar yousha avatar youshaaleayoub avatar zoghal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.