PHP 4.0 Bug #9076: GregorianToJD function returns incorrect values
| From: | basil dot hussain at specialreserve dot net | Date: | Fri, 02 Feb 2001 16:05:26 +0000 |
| Subject: | PHP 4.0 Bug #9076: GregorianToJD function returns incorrect values | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-45619@lists.php.net to get a copy of this message | ||
From: basil.hussain@specialreserve.net
Operating system: RedHat Linux 6.2 (kernel 2.2.18-22)
PHP version: 4.0.4pl1
PHP Bug Type: Calendar related
Bug description: GregorianToJD function returns incorrect values
The GregorianToJD Calender function returns incorrect
results. As far as I can tell, this applies to the
GregorianToSdn internal function in the PHP source.
There's not really any point putting a sample PHP script
here, as it's the algorithm that seems to be at fault. I
took two specific cases and worked through the
algorithm by hand (i.e. pen and paper). Here are the
results:
2nd February 2001 (2/2/2001) = 2451943
7th June 1980 (7/6/1980) = 2473618
As I understand it, the Julian Day Count is a uniform
count of days from some time around 4714 BC. Now,
how can 2/2/01 be a lesser number of days than
7/6/80?
I have no idea what the correct results for these test
cases are, nor any idea what particular part of the
algorithm is wrong. It's just wrong somewhere!
--
Edit Bug report at: http://bugs.php.net/?id=9076&edit=1