In this article, you will learn how to get the Julian Day Count from the date. The cal_to_jd() function converts a date in the given calendar to the Julian Day Count.
Note: The JulianDayCount is the count of days since Julian Day (January 1, 4713 B.C.).
What is the syntax of the cal_to_jd() function in PHP?
cal_to_jd(calendar,month,day,year);
Parameters | Details |
---|---|
calendar | Specify one of the calendars below to convert from CAL_GREGORIAN CAL_JULIAN CAL_JEWISH CAL_FRENCH |
month | Month (as numeric number) – Required |
day | Day (as numeric number) – Required |
year | Year (as numeric number) – Required |
Examples of cal_to_jd() function
Example 1. Convert 10th of January, 2021 (Gregorian calendar) to Julian Day Count.
<?php
$date=cal_to_jd(CAL_GREGORIAN,01,10,2021);
echo $date;
?>