Bug #54396 [NEW]: Php appears to be one day off with Julian Day count
| From: | satovey at yahoo dot com | Date: | Sat, 26 Mar 2011 17:02:28 +0000 |
| Subject: | Bug #54396 [NEW]: Php appears to be one day off with Julian Day count | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-159799@lists.php.net to get a copy of this message | ||
From:
Operating system: Win7
PHP version: 5.3SVN-2011-03-26 (SVN)
Package: Date/time related
Bug Type: Bug
Bug description:Php appears to be one day off with Julian Day count
Description:
------------
I am using Xamp on Windows 7 x64 in case that is relevant.
The following two sites:
http://www.fourmilab.ch/documents/calendar/
http://quasar.as.utexas.edu/BillInfo/JulianDateCalc.html
are in agreement. They produce a Julian Day count of 2455646.5 for
3/26/2011.
However, PHP's jdtogregorian() functions produces the following:
2455646.5 => 3/25/2011 || 2455647.5 => 3/26/2011
Test script:
---------------
$julianDayCntI = 2455646.5;
$julianDayCntII = 2455647.5;
$gregDateI = jdtogregorian($julianDayCntI);
$gregDateII = jdtogregorian($julianDayCntII);
echo "$julianDayCntI => $gregDateI || $julianDayCntII => $gregDateII <br
/>";
Expected result:
----------------
I do not have the mathematical skills to fix this bug, so I will leave
correcting this bug it up to those who are more mathematically astute.
--
Edit bug report at http://bugs.php.net/bug.php?id=54396&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=54396&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=54396&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=54396&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=54396&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=54396&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=54396&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=54396&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=54396&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=54396&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=54396&r=support
Expected behavior: http://bugs.php.net/fix.php?id=54396&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=54396&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=54396&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=54396&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=54396&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=54396&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=54396&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=54396&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=54396&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=54396&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=54396&r=mysqlcfg