Monday 26 August 2013

PHP Function gregoriantojd()

Syntax

gregoriantojd ( $month, $day, $year );

Definition and Usage

This function Converts a Gregorian date to Julian Day Count. Valid Range for Gregorian Calendar 4714 B.C. to 9999 A.D.

Paramters

ParameterDescription
monthRequired. The month as a number from 1 (for January) to 12 (for December)
dayRequired. The day as a number from 1 to 31
yearRequired. The year as a number between -4714 and 9999

Return Value

The julian day for the given gregorian date as an integer.

Example

Try out following example:
<?php
$jd = gregoriantojd(10, 11, 1970);
echo "$jd<br />";
$gregorian = jdtogregorian($jd);
echo "$gregorian<br />";
?> 
This will produce following result:
2440871
10/11/1970

No comments:

Post a Comment