$jdday_number = cal_to_jd(CAL_JULIAN,12,4,2013);
print_r(cal_from_jd($jdday_number,CAL_JULIAN));
The output is here
Array ( [date] => 12/4/2013 [month] => 12 [day] => 4 [year] => 2013 [dow] => 2 [abbrevdayname] => Tue [dayname] => Tuesday [abbrevmonth] => Dec [monthname] => December )
cal_from_jd(julian_day INT,CAL_GREGORIAN)
This example demonstrates how to convert a Julian Day Number to a Gregorian calendar date using cal_from_jd().
$jd = 2451545; // Example Julian Day
$date = cal_from_jd($jd, CAL_GREGORIAN);
print_r($date);
Output:
Array
(
[date] => 1/1/2000
[month] => 1
[day] => 1
[year] => 2000
[dow] => 6
[abbrevdayname] => Sat
[dayname] => Saturday
[abbrevmonth] => Jan
[monthname] => January
)
1
---
This example converts a Julian Day Number to the Jewish calendar system using cal_from_jd().
$jd = 2451545; // Example Julian Day
$date = cal_from_jd($jd, CAL_JEWISH);
print_r($date);
Output:
Array
(
[date] => 4/23/5760
[month] => 4
[day] => 23
[year] => 5760
[dow] => 6
[abbrevdayname] => Sat
[dayname] => Saturday
[abbrevmonth] => Tevet
[monthname] => Tevet
)
---
This example demonstrates converting a Julian Day Number into the French Republican calendar system.
$jd = 2375840; // Example Julian Day
$date = cal_from_jd($jd, CAL_FRENCH);
print_r($date);
Output:
Array
(
[date] => 1/1/1
[month] => 1
[day] => 1
[year] => 1
[dow] => 6
[abbrevdayname] => Sat
[dayname] => Saturday
[abbrevmonth] => Vendemiaire
[monthname] => Vendemiaire
)
Author
🎥 Join me live on YouTubePassionate about coding and teaching, I publish practical tutorials on PHP, Python, JavaScript, SQL, and web development. My goal is to make learning simple, engaging, and project‑oriented with real examples and source code.