Converts a Gregorian date to Julian Day Count
gregoriantojd(int $month, int $day, int $year): int
The month as a number from 1 (January) to 12 (December)
The day as a number from 1 to 31. If the month has less days then given, overflow occurs.
The year as a number between -4714 and 9999. Negative numbers mean years B.C., positive numbers mean years A.D. Note that there is no year 0; December 31, 1 B.C. is immediately followed by January 1, 1 A.D.
The julian day for the given gregorian date as an integer. Dates outside the valid range return 0.
month day year
<? $month = 1; $day = 1; $year = 1; $return = gregoriantojd($month, $day, $year); echo $return; ?>
<? $month1 = 2; $month2 = 3; $day1 = 31; $day2 = 3; $year = 1; $return1 = gregoriantojd($month1, $day1, $year); $return2 = gregoriantojd($month2, $day2, $year); echo $return1 . PHP_EOL; echo $return2; ?>