PHP gregoriantojd() Function
Definition
The gregoriantojd() function converts a date from the Gregorian Calendar to a Julian Day Count.
Syntax
PHP gregoriantojd() Function has the following syntax.
gregoriantojd(month,day,year);
Parameter
Parameter | Is Required | Description |
---|---|---|
month | Required. | Month as a number from 1 to 12 |
day | Required. | Day as a number from 1 to 31 |
year | Required. | Year as a number between -4714 and 9999 |
Return
PHP gregoriantojd() Function returns a Julian Day number.
Example
Convert a Gregorian date to a Julian Day Count and back to a Gregorian date:
<?php/* w ww . j av a 2s.c om*/
$jd=gregoriantojd(6,20,2013);
echo $jd . "\n";
echo jdtogregorian($jd);
?>
The code above generates the following result.