forked from zoghal/PersianDate4MySQL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
59 lines (50 loc) · 2.08 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[MySQL] pDate
==========
Contents/Menu
- About
- Requirements
- Download
- Installation
- Help/Wiki
- License
- Issues/Feedbacks
About
----------
[MySQL] pDate is a Gregorian / Jalali date converter functions for MySQL.
Requirements
----------
- MySQL 5+
Download
----------
zip: https://github.com/zoghal/Presian-Date-for-MySQL/zipball/master
tgz: https://github.com/zoghal/Presian-Date-for-MySQL/tarball/master
git http: git clone http: https://github.com/zoghal/Presian-Date-for-MySQL.git
git: git clone git://github.com/zoghal/Presian-Date-for-MySQL.git
Installation
----------
Execute the pDate.sql file.
Help/Wiki
----------
User can use these six functions, which are provided on a set.
1. Pdate(datetime)
Takes georgian datetime as input and gives jalali date in text format as output.
2. PMONTH(datetime)
Takes georgian datetime as input and gives jalali month number in text format as output.
3. Pmonthname(datetime)
Takes georgian datetime as input and gives jalali month name in text format as output.
4. Pyear(datetime)
Takes georgian datetime as input and gives jalali year number in text format as output.
5. Pday(datetime)
Takes georgian datetime as input and gives jalali day number in text format as output.
6. Gdate(year smallint, month smallint, day smallint)
Takes jalali date in year,month,day format as input and gives georgian date in datetime format as output.
7. Gdatestr(jdate char(10))
Takes jalali date in string format (e.g: '1390/3/3', '1390/03/3', '1390/3/03, '1390/03/03') as input and gives georgian date in datetime format as output. You can not enter Jalali year in short form! e.g '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 after downloading and importing the script.
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](http://www.gnu.org/licenses/gpl.txt)
Issues/Feedbacks
----------
https://github.com/zoghal/Presian-Date-for-MySQL/issues