w3resource
PHP Tutorial

PHP: gregoriantojd() function

Description

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

PHP Function Reference

Previous: FrenchToJD
Next: JDDayOfWeek



New Content: Composer: Dependency manager for PHP, R Programming


bedava porno