PHP26-PHP Calendar Functions

PHP Calendar Introduction The calendar functions are useful when working with different calendar formats. The standard it is based on is t...

PHP Calendar Introduction

The calendar functions are useful when working with different calendar formats. The standard it is based on is the Julian day count (Julian day count is a count of days starting from January 1, 4713 B.C.). Note that the Julian day count is not the same as the Julian calendar!
Note: To convert between calendar formats, you must first convert to Julian day count, then to the calendar format.

Installation

The windows version of PHP has built-in support for the calendar extension. So, the calendar functions will work automatically.
However, if you are running the Linux version of PHP, you will have to compile PHP with --enable-calendar to get the calendar functions to work.

PHP Calendar Functions

PHP: indicates the earliest version of PHP that supports the function.

Function Description PHP
cal_days_in_month() Returns the number of days in a month for a specified year and calendar 4
cal_from_jd() Converts a Julian day count into a date of a specified calendar 4
cal_info() Returns information about a given calendar 4
cal_to_jd() Converts a date to Julian day count 4
easter_date() Returns the Unix timestamp for midnight on Easter of a specified year 3
easter_days() Returns the number of days after March 21, on which Easter falls for a specified year 3
FrenchToJD() Converts a French Republican date to a Julian day count 3
GregorianToJD() Converts a Gregorian date to a Julian day count 3
JDDayOfWeek() Returns the day of a week 3
JDMonthName() Returns a month name 3
JDToFrench() Converts a Julian day count to a French Republican date 3
JDToGregorian() Converts a Julian day count to a Gregorian date 3
jdtojewish() Converts a Julian day count to a Jewish date 3
JDToJulian() Converts a Julian day count to a Julian date 3
jdtounix() Converts a Julian day count to a Unix timestamp 4
JewishToJD() Converts a Jewish date to a Julian day count 3
JulianToJD() Converts a Julian date to a Julian day count 3
unixtojd() Converts a Unix timestamp to a Julian day count 4


PHP Calendar Constants

PHP: indicates the earliest version of PHP that supports the constant.

Constant Description PHP
CAL_GREGORIAN Gregorian calendar 3
CAL_JULIAN Julian calendar 3
CAL_JEWISH Jewish calendar 3
CAL_FRENCH French Republican calendar 3
CAL_NUM_CALS   3
CAL_DOW_DAYNO   3
CAL_DOW_SHORT   3
CAL_DOW_LONG   3
CAL_MONTH_GREGORIAN_SHORT   3
CAL_MONTH_GREGORIAN_LONG   3
CAL_MONTH_JULIAN_SHORT   3
CAL_MONTH_JULIAN_LONG   3
CAL_MONTH_JEWISH   3
CAL_MONTH_FRENCH   3
CAL_EASTER_DEFAULT   4
CAL_EASTER_DEFAULT   4
CAL_EASTER_ROMAN   4
CAL_EASTER_ALWAYS_GREGORIAN   4
CAL_EASTER_ALWAYS_JULIAN   4
CAL_JEWISH_ADD_ALAFIM_GERESH   5
CAL_JEWISH_ADD_ALAFIM   5
CAL_JEWISH_ADD_GERESHAYIM   5
Name

ADO,131,ASP,3,C++,61,CORE JAVA,1,CSS,115,HTML,297,index,5,JAVASCRIPT,210,OS,47,PHP,65,SAD,53,SERVLETS,23,SOFTWARE ENGINEERING,245,SQL,71,TCP/IP,1,XHTML,9,XML,18,
ltr
item
Best Online Tutorials | Source codes | Programming Languages: PHP26-PHP Calendar Functions
PHP26-PHP Calendar Functions
Best Online Tutorials | Source codes | Programming Languages
https://www.1000sourcecodes.com/2012/10/php26-php-calendar-functions.html
https://www.1000sourcecodes.com/
https://www.1000sourcecodes.com/
https://www.1000sourcecodes.com/2012/10/php26-php-calendar-functions.html
true
357226456970214079
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy Table of Content