Example 1 — Gregorian Date to Jewish Date
Convert January 1, 2024 and the start of the Jewish year 5784 into Jewish calendar dates.
<?php
$jd = gregoriantojd(1, 1, 2024);
echo jdtojewish($jd), PHP_EOL;
echo jdtojewish(gregoriantojd(9, 16, 2023)), PHP_EOL;
var_dump(jdtojewish($jd)); How It Works
- gregoriantojd() turns January 1, 2024 into a Julian Day number.
- jdtojewish() returns 4/20/5784, which is the 20th day of Tevet (month 4) in the year 5784.
- September 16, 2023 was Rosh Hashanah, which is 1 Tishri, so the result is 1/1/5784.
- var_dump() shows that the result is a string, not a number.

