Example 1 — Julian Day to Date
Convert a few Julian Day numbers into readable Gregorian dates.
<?php
echo jdtogregorian(2451545), PHP_EOL;
echo jdtogregorian(2460311), PHP_EOL;
echo jdtogregorian(2460670), PHP_EOL;
echo jdtogregorian(gregoriantojd(7, 4, 2024)), PHP_EOL; How It Works
- 2451545 is the Julian Day for January 1, 2000.
- 2460311 is the Julian Day for January 1, 2024.
- 2460670 is 359 days later, which is December 25, 2024.
- Converting a date to a number and back gives you the same date.

