The cal_to_jd() function converts a date in a specified calendar to Julian Day Count.
PHP cal_to_jd() Function has the following syntax.
cal_to_jd(calendar,month,day,year);
Parameter | Is Required | Description |
---|---|---|
calendar | Required. | Calendar to convert from. |
month | Required. | Month as a number |
day | Required. | Day as a number |
year | Required. | Year as a number |
calendar must be one of the following values:
PHP cal_to_jd() Function returns a Julian Day number.
Convert 20th of June, 2013 (Gregorian calendar) to Julian Day Count:
<?php
$d=cal_to_jd(CAL_GREGORIAN,6,20,2013);
echo $d;
?>
The code above generates the following result.