PHP GregorianToJD

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

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 :

  1. echo gregoriantojd(4,21,1976).'
    ';  

  2. echo gregoriantojd(10,3,2076);  

  3. ?>  

Output :

2442890
2479580