dev-master
9999999-dev https://github.com/jalaali/jalaali-phpPHP functions for converting Jalaali and Gregorian calendar systems to each other.
MIT
The Requires
- php >=5.3.0
by Navid Emami
gregorian julian jalaali
Wallogit.com
2017 © Pedro Peláez
PHP functions for converting Jalaali and Gregorian calendar systems to each other.
PHP implementation of jalaali.js which contains functions for converting Jalaali and Gregorian calendar systems to each other., (*1)
Jalaali calendar system has different names such as:, (*2)
The base algorithm is a derived work of Omar Khayyam, who completed the calendar system more than 900 years ago., (*3)
Jalaali calendar is a solar calendar that was used in Persia, variants of which today are still in use in Iran as well as Afghanistan. Read more or see Calendar Converter., (*4)
Calendar conversion is based on the algorithm provided by Kazimierz M. Borkowski and has a very good performance., (*5)
composer require jalaali/jalaali-php, (*6)
Base Jalaali class is defined with 10 static methods inside Jalaali namespace, so there's no need for instantiation. For example, to convert Gregorian date to Jalaali use this code:, (*7)
// PHP 3.0.x date to Jalaali :) \Jalaali\Jalaali::toJalaali(2000, 10, 20)
There is a complete documentation page for this project on docs/api folder but the list of methods is as follows:, (*8)
toJalaali($gy, $gm, $gd) : Converts a Gregorian date to Jalaali, (*9)
toGregorian($jy, $jm, $jd) : Converts a Jalaali date to Gregorian, (*10)
isValidJalaaliDate($jy, $jm, $jd) : Checks whether a Jalaali date is valid or not, (*11)
isLeapJalaaliYear($jy) : Checks whether this is a leap year or not, (*12)
jalaaliMonthLength($jy, $jm) : Number of days in a given month in Jalaali year, (*13)
jalaaliCalendar($jy) : Base Algorithm, (*14)
j2d($jy, $jm, $jd) : Converts a date of the Jalaali calendar to the Julian Day Number, (*15)
d2j($jdn) : Converts the Julian Day Number to a date in the Jalaali calendar, (*16)
g2d($gy, $gm, $gd) : Calculates the Julian Day number from Gregorian or Julian calendar dates, (*17)
d2g($jdn) : Calculates Gregorian and Julian calendar dates from the Julian Day number, (*18)
PHP functions for converting Jalaali and Gregorian calendar systems to each other.
MIT
gregorian julian jalaali