From: jeromystewart at gmail dot com Operating system: WIN SERVER 2008 VIA IIS PHP version: 5.3.21 Package: Scripting Engine problem Bug Type: Feature/Change Request Bug description:function strtotime seems to be inaccurate
Description: ------------ My version of PHP wasn't on the list, it is actually 5.3.8 on WIN2008 (ISS) When calculating the unix timestamp for a given day (see Test Script) I wouldn't expect there to be a remainder at all. The test script below demonstrates that there is a remainder ... and that remainder changes from the 13th to the 14th of March 2011. When I ran the same script on my linux host I got the following 15045.291666667 15046.291666667 15047.291666667 15048.291666667 At least with the above, the remainder is consistent. See below for the actual result on the windows server 2008 running IIS Test script: --------------- echo strtotime('2011-03-12 00:00:00')/(60*60*24); echo '<hr>'; echo strtotime('2011-03-13 00:00:00')/(60*60*24); echo '<hr>'; echo strtotime('2011-03-14 00:00:00')/(60*60*24); echo '<hr>'; echo strtotime('2011-03-15 00:00:00')/(60*60*24); echo '<hr>'; Expected result: ---------------- Expected Result: 15045.0 <hr> 15046.0 <hr> 15047.0 <hr> 15048.0 <hr> Actual result: -------------- Actual Result: 15045.333333333 <hr> 15046.333333333 <hr> 15047.291666667 <hr> 15048.291666667 <hr> -- Edit bug report at https://bugs.php.net/bug.php?id=64148&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64148&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64148&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64148&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64148&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64148&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64148&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64148&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64148&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=64148&r=support Expected behavior: https://bugs.php.net/fix.php?id=64148&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64148&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64148&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64148&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64148&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64148&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64148&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=64148&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64148&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64148&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64148&r=mysqlcfg