The gregoriantojd() function converts a date from the Gregorian Calendar to a Julian Day Count.
PHP gregoriantojd() Function has the following syntax.
gregoriantojd(month,day,year);
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 |
PHP gregoriantojd() Function returns a Julian Day number.
Convert a Gregorian date to a Julian Day Count and back to a Gregorian date:
<?php
$jd=gregoriantojd(6,20,2013);
echo $jd . "\n";
echo jdtogregorian($jd);
?>
The code above generates the following result.
The following code shows how to return the abbreviated Gregorian monthname of 13th January, 2014.
<?php
$jd=gregoriantojd(1,13,2014);
echo jdmonthname($jd,0);
?>
The code above generates the following result.