Menu Samaritan's Purse

GREGORIANTOJD

Converts a Gregorian date to Julian Day Count

SYNTAX

gregoriantojd ( int $month , int $day , int $year ) : int

PARAMETERS

month

The month as a number from 1 (January) to 12 (December)

day

The day as a number from 1 to 31. If the month has less days then given, overflow occurs.

year

The year as a number between -4714 and 9999. Negative numbers mean years B.C., positive numbers mean years A.D. Note that there is no year 0; December 31, 1 B.C. is immediately followed by January 1, 1 A.D.

RETURN

The julian day for the given gregorian date as an integer. Dates outside the valid range return 0.

EXAMPLES

MONTH DAY YEAR

1721426

OVERFLOW

1721487
1721487

PHP