- PHP Tutorial
- PHP - Home
- PHP - Introduction
- PHP - Environment Setup
- PHP - History
- PHP - Syntax
- PHP - Hello World
- PHP - Comments
- PHP - Variables
- PHP - Echo/Print
- PHP - var_dump
- PHP - $ and $$ Variables
- PHP - Constants
- PHP - Magic Constants
- PHP - Data Types
- PHP - Type Casting
- PHP - Type Juggling
- PHP - Operators
- PHP - Strings
- PHP - Boolean
- PHP - Integers
- PHP - Files & I/O
- PHP - Heredoc & Nowdoc
- PHP - Compound Types
- PHP - File Include
- PHP - Date & Time
- PHP - Scalar Type Declarations
- PHP - Return Type Declarations
- PHP - Spread Operator
- PHP - Null Coalescing Operator
- PHP - Spaceship Operator
- PHP Control Statements
- PHP - Decision Making
- PHP - If…Else Statement
- PHP - Switch Statement
- PHP - For Loop
- PHP - Foreach Loop
- PHP - While Loop
- PHP - Do…While Loop
- PHP - Break Statement
- PHP - Continue Statement
- PHP Arrays
- PHP - Arrays
- PHP - Indexed Array
- PHP - Associative Array
- PHP - Multidimensional Array
- PHP - Array Functions
- PHP - Constant Arrays
- PHP Functions
- PHP - Functions
- PHP - Function Parameters
- PHP - Call by value
- PHP - Call by Reference
- PHP - Default Arguments
- PHP - Named Arguments
- PHP - Variable Arguments
- PHP - Returning Values
- PHP - Passing Functions
- PHP - Recursive Functions
- PHP - Type Hints
- PHP - Variable Scope
- PHP - Strict Typing
- PHP - Anonymous Functions
- PHP - Arrow Functions
- PHP - Variable Functions
- PHP - Global Variables
- PHP Superglobals
- PHP - Superglobals
- PHP - $GLOBALS
- PHP - $_SERVER
- PHP - $_REQUEST
- PHP - $_POST
- PHP - $_GET
- PHP - $_FILES
- PHP - $_ENV
- PHP - $_COOKIE
- PHP - $_SESSION
- PHP File Handling
- PHP - File Handling
- PHP - Open File
- PHP - Read File
- PHP - Write File
- PHP - File Existence
- PHP - Download File
- PHP - Copy File
- PHP - Append File
- PHP - Delete File
- Object Oriented PHP
- PHP - Object Oriented Programming
- PHP Web Development
- PHP - Web Concepts
- PHP - Form Validation
- PHP - Complete Form
- PHP - File Inclusion
- PHP - GET & POST
- PHP - File Uploading
- PHP - Cookies
- PHP - Sessions
- PHP - Sending Emails
- PHP AJAX
- PHP - AJAX Introduction
- PHP - AJAX Search
- PHP - AJAX XML Parser
- PHP - AJAX Auto Complete Search
- PHP - AJAX RSS Feed Example
- PHP Login Example
- PHP - Login Example
- PHP - Facebook Login
- PHP - Paypal Integration
- PHP - MySQL Login
- PHP Advanced
- PHP - MySQL
- PHP - Coding Standard
- PHP - Regular Expression
- PHP - Error Handling
- PHP - Bugs Debugging
- PHP - For C Developers
- PHP - For PERL Developers
- PHP - Frameworks
- PHP - Core PHP vs Frame Works
- PHP - Design Patterns
- PHP - Closure::call()
- PHP - Filtered unserialize()
- PHP - IntlChar
- PHP - CSPRNG
- PHP - Expectations
- PHP - Use Statement
- PHP - Integer Division
- PHP - Deprecated Features
- PHP - Removed Extensions & SAPIs
- PHP - Built-In Functions
- PHP Useful Resources
- PHP - Questions & Answers
- PHP - Useful Resources
- PHP - Discussion
PHP - Calendar Functions
The calendar extension presents a series of functions to simplify converting between different calendar formats.
The intermediary or standard it is based on is the Julian Day Count. The Julian Day Count is a count of days starting from January 1st, 4713 B.C. To convert between calendar systems, you must first convert to Julian Day Count, then to the calendar system of your choice.
Installation
To get these functions to work, you have to compile PHP with --enable-calendar.
Runtime Configuration
This extension has no configuration directives defined in php.ini.
PHP Calendar Constants
Sr.No | Constant & Description | PHP |
---|---|---|
1 |
CAL_GREGORIAN Gregorian calendar |
3 |
2 |
CAL_JULIAN Julian calendar |
3 |
3 |
CAL_JEWISH Jewish calendar |
3 |
4 |
CAL_FRENCH French Republican calendar |
3 |
5 |
CAL_NUM_CALS |
3 |
6 |
CAL_DOW_DAYNO |
3 |
7 |
CAL_DOW_SHORT |
3 |
8 |
CAL_DOW_LONG |
3 |
9 |
CAL_MONTH_GREGORIAN_SHORT |
3 |
10 |
CAL_MONTH_GREGORIAN_LONG |
3 |
11 |
CAL_MONTH_JULIAN_SHORT |
3 |
12 | CAL_MONTH_JULIAN_LONG |
3 |
13 |
CAL_MONTH_JEWISH |
3 |
14 |
CAL_MONTH_FRENCH |
3 |
15 |
CAL_EASTER_DEFAULT |
4 |
16 |
CAL_EASTER_DEFAULT |
4 |
17 |
CAL_EASTER_ROMAN |
4 |
18 |
CAL_EASTER_ALWAYS_GREGORIAN |
4 |
19 |
CAL_EASTER_ALWAYS_JULIAN |
4 |
20 |
CAL_JEWISH_ADD_ALAFIM_GERESH |
5 |
21 |
CAL_JEWISH_ADD_ALAFIM |
5 |
22 |
CAL_JEWISH_ADD_GERESHAYIM |
5 |
List of Functions
PHP − indicates the earliest version of PHP that supports the function.
Sr.No | Function & Description | PHP |
---|---|---|
1 | cal_days_in_month()
Returns the number of days in a month for a specified year and calendar |
4 |
2 | cal_from_jd()
Converts a Julian day count into a date of a specified calendar |
4 |
3 | cal_from_jd()
Returns information about a given calendar |
4 |
4 | cal_to_jd()
Converts a date to Julian day count |
4 |
5 | easter_date()
Returns the Unix timestamp for midnight on Easter of a specified year |
3 |
6 | easter_days()
Returns the number of days after March 21, on which Easter falls for a specified year |
3 |
7 | FrenchToJD()
Converts a French Republican date to a Julian day count |
3 |
8 | GregorianToJD()
Converts a Gregorian date to a Julian day count |
3 |
9 | JDDayOfWeek()
Returns the day of a week |
3 |
10 | JDMonthName()
Returns a month name |
3 |
11 | JDToFrench()
Converts a Julian day count to a French Republican date |
3 |
12 | JDToGregorian()
Converts a Julian day count to a Gregorian date |
3 |
13 | jdtojewish()
Converts a Julian day count to a Jewish date |
3 |
14 | JDToJulian()
Converts a Julian day count to a Julian date |
3 |
15 | jdtounix()
Converts a Julian day count to a Unix timestamp |
4 |
16 | JewishToJD()
Converts a Jewish date to a Julian day count |
3 |
17 | JulianToJD()
Converts a Julian date to a Julian day count |
3 |
18 | unixtojd()
Converts a Unix timestamp to a Julian day count |
4 |