English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The calendar extension provides a series of functions to simplify the conversion between different calendar formats.
The calendar extension includes functions to simplify the conversion between different calendar formats.
It is based on Julian Day Count (JD) and starts from BC 4713 Year 1 Month 1 The calculation starts from the day.
Note:To convert between calendar formats, you must first convert to Julian Day Count and then convert to the calendar format you need.
Note:Julian Day Count (JD) and Julian Calendar are not the same thing!
In order for these functions to work, you must --enable-compile PHP with calendar.
The Windows version of PHP has built-in support for the calendar extension. Therefore, the Calendar functions will work automatically.
Function | Description |
---|---|
cal_days_in_month() | Return the number of days in a month for a specified year and calendar system. |
cal_from_jd() | Convert the Julian Day Count to a date of the specified calendar system. |
cal_info() | Return information about the specified calendar system. |
cal_to_jd() | Convert a date of a specified calendar system to the Julian Day Count. |
easter_date() | Return the Unix timestamp for the specified year's Easter midnight. |
easter_days() | Return the number of days between the specified year's Easter and 3 Month 21 Days between dates. |
frenchtojd() | Convert French Republican calendar date to Julian day count. |
gregoriantojd() | Convert Gregorian calendar date to Julian day count. |
jddayofweek() | Return the day of the week for the date. |
jdmonthname() | Return the name of the month. |
jdtofrench() | Convert Julian day count to French Republican calendar date. |
jdtogregorian() | Convert Julian day count to Gregorian calendar date. |
jdtojewish() | Convert Julian day count to Jewish calendar date. |
jdtojulian() | Convert Julian day count to Julian calendar date. |
jdtounix() | Convert Julian day count to Unix timestamp. |
jewishtojd() | Convert Jewish calendar date to Julian day count. |
juliantojd() | Convert Julian calendar date to Julian day count. |
unixtojd() | Convert Unix timestamp to Julian day count. |
Constants | Type | PHP version |
---|---|---|
CAL_GREGORIAN | Integer | PHP 4 |
CAL_JULIAN | Integer | PHP 4 |
CAL_JEWISH | Integer | PHP 4 |
CAL_FRENCH | Integer | PHP 4 |
CAL_NUM_CALS | Integer | PHP 4 |
CAL_DOW_DAYNO | Integer | PHP 4 |
CAL_DOW_SHORT | Integer | PHP 4 |
CAL_DOW_LONG | Integer | PHP 4 |
CAL_MONTH_GREGORIAN_SHORT | Integer | PHP 4 |
CAL_MONTH_GREGORIAN_LONG | Integer | PHP 4 |
CAL_MONTH_JULIAN_SHORT | Integer | PHP 4 |
CAL_MONTH_JULIAN_LONG | Integer | PHP 4 |
CAL_MONTH_JEWISH | Integer | PHP 4 |
CAL_MONTH_FRENCH | Integer | PHP 4 |
CAL_EASTER_DEFAULT | Integer | PHP 4.3 |
CAL_EASTER_ROMAN | Integer | PHP 4.3 |
CAL_EASTER_ALWAYS_GREGORIAN | Integer | PHP 4.3 |
CAL_EASTER_ALWAYS_JULIAN | Integer | PHP 4.3 |
CAL_JEWISH_ADD_ALAFIM_GERESH | Integer | PHP 5.0 |
CAL_JEWISH_ADD_ALAFIM | Integer | PHP 5.0 |
CAL_JEWISH_ADD_GERESHAYIM | Integer | PHP 5.0 |