Web | This Site

Learning PHP
Advanced PHP
PHP Function Reference
PHP Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM

| Home |  | References |  | Discussion Forums |  | About TP

# 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

Parameter | Description
--- | ---
month | Required. The month as a number from 1 (for January) to 12 (for December)
day | Required. The day as a number from 1 to 31
year | Required. 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

Advertisement

Online Image Processing

Indian Baby Names