Convert a Gregorian date to a Julian day count and back to a Gregorian date:
<?php$jd=gregoriantojd(6,20,2007);echo $jd . "<br>";echo jdtogregorian($jd);?>The gregoriantojd() function converts a Gregorian date to a Julian day count.
Note: Although this function handles dates before 4714 BC, you should note that the Gregorian calendar was only established in 1582, and some countries accepted it even later (Great Britain in 1752, the Soviet Union in 1918, and Greece in 1923 Year). Most European countries use the Julian calendar (Gregorian calendar) before the Gregorian calendar.
Tip: See the jdtogregorian() function, which converts Julian day counts to Gregorian dates.
gregoriantojd( month,day,year);
parameter | describe |
---|---|
month | Required. A number from 1 to 12 specifying the month. |
day | Required. A number from 1 to 31 specifying the day. |
year | Required. A number from -4714 (representing 4714 BC) to 9999 (representing 9999 AD) specifying the year. |
Return value: | Returns the Julian day number. |
---|---|
PHP version: | 4+ |