To get these functions to work, you have to compile PHP with -enable-calendar. The Windows version of PHP has built-in support for this extension. You do not need to load any additional extensions in order to use these functions.
![Install Install](/uploads/1/2/5/8/125863573/777845398.jpg)
- PHP Tutorial
- Advanced PHP
- PHP Form Examples
- PHP login Examples
- PHP AJAX Examples
- PHP XML Example
- PHP Frame Works
- PHP Design Patterns
- PHP Function Reference
- PHP Useful Resources
- Selected Reading
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 |
For cPanel & WHM version 68
(WHM >> Home >> Software >> Module Installers)
Overview
Use this section of the Module Installers interface to manage and install PEAR (PHP Extensions and Applications Repository) modules.
To manage installed and available PEAR modules, click Manage next to PHP Pear.
PHP Extensions and Applications Package Magic User Loader
Note:
We deprecated the Magic User Loader feature for EasyApache 4. If EasyApache 4 is installed on your server, you will not see this feature.
This feature allows users to integrate PHP extensions into scripts, without the need to specify a separate path to the installed extensions.
To enable the Magic User Loader, click Enable. To disable the Magic User Loader, click Disable.
Warning:
- If you migrate a site from a server with the Magic User Loader enabled to a server with the Magic User Loader disabled, you may receive “file not found” errors for
/Library
files. For example: - You may also receive “file not found” errors if you migrate a site from a server with Magic User Loader disabled to a server with Magic User Loader enabled.
Select a PHP version
![Install Install](/uploads/1/2/5/8/125863573/723244623.png)
This feature allows you to specify the version of PHP on which you will install the modules.
To select a specific version of PHP, perform the following steps:
- Select a PHP version from the menu.
- Click Apply.
PHP Extensions and Applications Package Installer
This feature allows you to search for, download, and install extensions from the PEAR repository.
Note:
If you know the exact name of the extension that you wish to install, enter its name in the Install a PHP Extensions and Applications Package text box and click Install Now.
To search for and install a PHP extension, perform the following steps:
- Use one of the following methods to find the desired extension:
- Enter a search term in the available text box and click Go.
- Click Show Available PHP Extension(s) and Application(s) to list PHP extensions that are available from PEAR.
- The interface displays the following information for all of the displayed extensions:
- Module Name — The extension's name.
- Version — The extension's version number.
- Description — A description of the extension.
- Actions — The actions that you may perform for that extension.
- Click Install next to the extension that you wish to download and install.
- To view an extension’s documentation, click Show Docs for that extension.
- If you did not find the desired extension, enter a new keyword in the Search text box and click Go.
Installed PHP Extension(s) and Application(s)
The Installed PHP Extension(s) and Application(s) table lists all of the extensions that are currently installed on your server.
For each installed extension, the table displays the following information:
Column | Description |
---|---|
Module Name | The extension's name. |
Version | The extension's version number. |
Actions | You can perform the following actions for each extension:
|
Additional documentation
Content by labelThere is no content with the specified labels
Content by labelThere is no content with the specified labels
Content by labelThere is no content with the specified labels