PHP cal_to_jd() Function
Definition
The cal_to_jd() function converts a date in a specified calendar to Julian Day Count.
Syntax
PHP cal_to_jd() Function has the following syntax.
cal_to_jd(calendar,month,day,year);
Parameter
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:
- CAL_GREGORIAN
- CAL_JULIAN
- CAL_JEWISH
- CAL_FRENCH
Return
PHP cal_to_jd() Function returns a Julian Day number.
Example
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.