Example 1 — Timestamp to Julian Day
Convert a fixed timestamp for noon UTC on January 1, 2024 and look at the date it represents.
<?php
$jd = unixtojd(1704110400);
echo $jd, PHP_EOL;
echo jdtogregorian($jd), PHP_EOL;
echo jddayofweek($jd, CAL_DOW_LONG), PHP_EOL; How It Works
- The timestamp 1704110400 is noon (12:00) UTC on January 1, 2024.
- unixtojd() drops the time and returns the Julian Day number 2460311.
- jdtogregorian() turns that number into the text 1/1/2024.
- jddayofweek() with mode 1 shows that the day was a Monday.

