PHP: gregoriantojd() function
Converts a Gregorian date to Julian Day Count
The gregorianToJD() function converts a Gregorian date to Julian day count.
Version:
(PHP 4 and above)
Syntax:
gregoriantojd(month, day, year)
Parameter:
Name | Description | Required / Optional |
Type |
---|---|---|---|
month | 1 to 12 ( i.e. January to December). | Required | Integer. |
day | The day as a number between 1 to 31. | Required | Integer. |
year | The year as a number between -4714 to 9999. | Required | Integer. |
Return value
The Julian day for the given Gregorian date.
Value Type: Integer.
Example:
<?php
echo gregoriantojd(4,21,1976).'<br>';
echo gregoriantojd(10,3,2076);
?>
Sample Output:
2442890 2479580
View the example in the browser
See also
Previous: FrenchToJD
Next: JDDayOfWeek
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://www.w3resource.com/php/function-reference/GregorianToJD.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics