Example 1 — Julian Date to Julian Day
Convert two Julian calendar dates and compare them with the matching Gregorian dates.
<?php
echo juliantojd(10, 5, 1582), PHP_EOL;
echo gregoriantojd(10, 15, 1582), PHP_EOL;
echo juliantojd(12, 19, 1999), PHP_EOL;
echo gregoriantojd(1, 1, 2000), PHP_EOL; How It Works
- October 5, 1582 in the Julian calendar is the same day as October 15, 1582 in the Gregorian calendar.
- Both functions return 2299161 because the day itself is the same.
- December 19, 1999 in the Julian calendar is January 1, 2000 in the Gregorian calendar.
- Both return 2451545, so the two calendars agree on the Julian Day.

