#38754 [NEW]: 1 minute conversion error
| From: | mrobertson at hotmail dot com | Date: | Fri, 08 Sep 2006 19:44:06 +0000 |
| Subject: | #38754 [NEW]: 1 minute conversion error | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-101890@lists.php.net to get a copy of this message | ||
From: mrobertson at hotmail dot com
Operating system: Mac OS X 10.4.7
PHP version: 5.1.6
PHP Bug Type: Date/time related
Bug description: 1 minute conversion error
Description:
------------
There seems to be a 1 minute (3600 second) error in mktime
Reproduce code:
---------------
$onedayinsecs = 86400;
$timeS = mktime(0, 0, 0, 3, 26, 2006);
$timeS = $timeS + $onedayinsecs;
$dayS = mktime(0, 0, 0, 3, 27, 2006);
echo($timeS." - ".$dayS."<br/>");
Expected result:
----------------
The two values should be the same since we are adding 1 day in
seconds to mktime value of 3/26/06 and getting the mktime
value of 3/27/06.
Actual result:
--------------
1143417600 - 1143414000
The difference is 3600. Note if you start at 1/1/06 and go
through all the days in the year totalling seconds in
comparison to mktime this error exists between
3/27/06 and 10/29/06. From 30/10/06 the error corrects itself.
--
Edit bug report at http://bugs.php.net/?id=38754&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38754&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38754&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38754&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38754&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38754&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38754&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38754&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38754&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38754&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38754&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38754&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38754&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38754&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38754&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38754&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38754&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38754&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38754&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38754&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38754&r=mysqlcfg