Convert a Julian date to a Julian Day Number and then convert it back to a Julian date.
<?php $jd=juliantojd(6,20,2007); echo $jd . “<br>”; echo jdtojulian($jd); ?> |
The juliantojd()
function converts a date from the Julian Calendar to a Julian Day Number.
Note: While this function can handle dates as far back as 4713 B.C., the Julian calendar was introduced in 46 B.C. and did not become consistent until around 8 A.D. Additionally, the start of the year varied by culture, with not all cultures recognizing January as the first month. Today, the Gregorian calendar is used worldwide. To convert Gregorian dates to Julian Day Numbers, use the gregoriantojd()
function.
Tip: Use the jdtojulian()
function to convert a Julian Day Number back to a Julian date.
juliantojd(month,day,year); |
Parameter |
Description |
month |
Required. Specifies the month as a number between 1 and 12. |
day |
Required. Specifies the day as a number between 1 and 31. |
year |
Required. Specifies the year as a number between -4713 and 9999. |
Return Value: |
Returns a Julian Day Number. |
PHP Version: |
4+ |