PHP JulianToJD() Function

Example

Convert a Julian calendar date to Julian Day count and then convert it back to a Julian calendar date:

<?php
$jd=juliantojd(9,25,2016);
echo $jd . "<br>";
echo jdtojulian($jd);
?>

Run Example

Definition and Usage

juliantojd() converts Julian calendar dates to Julian Day counts.

Note:The valid date range for the function is from the year 4713 BC to the year 9999 AD. The function can calculate back to 4713 BC, but this is not very meaningful. The Julian calendar was established in 46 BC, but some details did not stabilize until 8 AD. Different cultures define the start of the year differently - not all countries agree that January is the first month of the year. Remember that the universally accepted calendar in the world today is the Gregorian calendar. The gregoriantojd() function is used to convert these dates to their Julian Day count.

Tip:See also jdtojulian() The function converts Julian Day count to Julian date.

Syntax

juliantojd(month,day,year);
Parameter Description
month Required. Required. Specifies the month between 1 and 12, numeric value.
day Required. Specifies the day between 1 and 31, numeric value.
year Required. Specifies the year between -4713 and 9999, numeric value.

Technical Details

Return Value: Returns the Julian Day number.
PHP Version: 4+