note 16516 added to function.gregoriantojd
| From: | php-general at lists dot php dot net | Date: | Fri, 02 Nov 2001 16:53:03 +0000 |
| Subject: | note 16516 added to function.gregoriantojd | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-20304@lists.php.net to get a copy of this message | ||
Just in case you don't have the calendar functions bound into the PHP you're using,
here's a replacement...
function GregorianToJD ($month,$day,$year) {
if ($month > 2) {
$month = $month - 3;
} else {
$month = $month + 9;
$year = $year - 1;
}
$c = floor($year / 100);
$ya = $year - (100 * $c);
$j = floor((146097 * $c) / 4);
$j += floor((1461 * $ya)/4);
$j += floor(((153 * $month) + 2) / 5);
$j += $day + 1721119;
return $j;
}
--
http://www.php.net/manual/en/function.gregoriantojd.php
http://master.php.net/manage/user-notes.php?action=edit+16516
http://master.php.net/manage/user-notes.php?action=delete+16516
http://master.php.net/manage/user-notes.php?action=reject+16516