English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP gregoriantojd() function usage and example

PHP Calendar Calendar Function Manual

gregoriantojd() function converts the Gregorian calendar date to Julian day count.

Syntax

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

Definition and Usage

The reasonable range of Gregorian calendar is4714 This function converts the Gregorian date to Julian day count. 9999 B.C. to
A.D.4714 Although this function can handle1582day (or Julian calendar)10day (or Julian calendar)15B.C. before the date, but it has no meaning. The Gregorian calendar until1582day (or Julian calendar)10year5month1752Year was invented, and some countries did not accept it for a long time. For example, the United Kingdom was in1918Year started using the Gregorian calendar, the Soviet Union was in1923Year, Greece was in

Year, most European countries use the Julian calendar.

ParameterSerial Number
1

Parameter and Description

day (required)1(month) to1month (required)12(month) to12(month) to

2

month) of the month

day (required)1from31to

3

numbers

year (required)-4714and9999between

Return value

Given the Julian day of a Gregorian date, an integer.

Online Example

Convert a Gregorian calendar date to Julian day count and then back to Gregorian calendar date:

<?php
     $jd = gregoriantojd(1, 12, 1990);
   echo "$jd";
   print "\n";
   
   $gregorian = jdtogregorian($jd);
   echo "$gregorian";
   print "\n";
?>
Test and see‹/›

Output result:

2447904 
1/12/1990

  PHP Calendar Calendar Function Manual