juliantojd


php apg

CONVERTS a Julian Calendar date to a Julian Day Number, (JDN).



<?php

int juliantojd 
int $month int $day int $year )


where,

$month The month number

$day 
The day number.

$year The year number

?>

 $month 


The month number.



 $day 


The day number.



 $year 


The year number.





Julian Day Number, (JDN) also known as Julian Day Count, (JDC), indicates the number of days elapsed since January 1, 4713 BC, Gregorian Calendar.

The Julian Calendar was introduced by Júlio Cesar in 46 BC, according the Gregorian Calendar, but the details did not stabilize until at least 8 AD, and perhaps as late at the 4th century.

The valid range for the Gregorian Calendar is from November 25, 4714 BC to at least December 31, 9999 AD.

Although this function can handle dates all the way back to 4714 BC, such use may not be meaningful.

The Gregorian Calendar was not instituted until October 15, 1582, (or October 5, 1582 in the Julian Calendar).

Some countries did not accept it until much later.

For example, Britain converted in 1752, The USSR in 1918 and Greece in 1923.

Most European countries used the Julian Calendar prior to the Gregorian.

The $month is expressed as a number from 1, (January), to 12, (December).

The $day is a number from 1 to 31.

If $day has less of the given $month, an overflow occurs.

The $year must be represented by a number between -4714 and 9999.

Negative values mean BC years, positive AD.

Note that there is no year ZERO.

The positive value begin in the year 1 AD.

The beginning of a year varied from one culture to another - not all accepted January as the first month.

The current calendar system being used worldwide is the Gregorian Calendar, that can be used to convert such dates to their Julian Day Count, (JDC).

This function can be considered inverse to the function jdtojulian.



  1 EXERCISE   

<?php
 
$now01  
microtime(1);

$mm01 idate('m'$now01); 

$dd01 idate('d'$now01); 

$yy01 idate('Y'$now01); 

$juliantojd01 juliantojd($mm01$dd01$yy01);

echo 
$mm01 '-' $dd01 '-' $yy01 '<sub>(month-day-year)&nbsp;&nbsp;Julian</sub> => ' $juliantojd01 '<sub>JDC</sub>';

?>

  2 EXERCISE   

<?php
 
$mm02 
1

$dd02 1

$yy02 = -4714

$juliantojd02 juliantojd($mm02$dd02$yy02);

echo 
$mm02 '-' $dd02 '-' $yy02 '<sub>(month-day-year)&nbsp;&nbsp;Julian</sub> => ' $juliantojd02 '<sub>JDC</sub>';

?>