Introduction
In this tutorial you will learn how to use PHP calendar functions. The PHP calendar functions are used to implement various types of calendar formats. Here I will explain some calendar functions and I am also describing some PHP calendar functions in PART 1 and PART 2.
PHP Calendar JDToJulian function
It converts a Julian day count to Julian calendar date in the from of "Month/Day/Year".
Syntax
| jdtojulian (jd) |
Parameters in JDToJulian function
It contains one parameter.
| Parameter | Description |
| jd | It specifies Julian day count as integer. |
Example of JDToJulian function
<?php
$daycount=juliantojd(12,26,2012);
echo $daycount ."</br>";
$jdday=jdtojulian($daycount);
echo $jdday;
?>
Output
PHP Calendar JDToUnix function
It converts Julian day count to Unix timestamp. Basically this function will return a Unix time stamp corresponding to the given Julian date. This function returns false if the given Julian day count is not in Gregorian date (must be 1970 -2037).
Syntax
| jdtounix (jd) |
Parameters in JDToUnix function
It contains one parameter.
| Parameter | Description |
| jd | It specifies Julian day count as integer. |
Example of JDToUnix function
<?php
$jdays=gregoriantojd(12,26,2012);
$unixtime=jdtounix($jdays);
echo $unixtime;
?>
Output
PHP Calendar JewishToJD function
It converts Jewish calendar to Julian day count and this function can handle dates all the way back to the year 1 (3761 B.C).
Syntax




Join the conversation! Your thoughts help the community grow.