ID: 48458 Updated by: [email protected] Reported By: post at oliver-schieche dot de -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: Debian 4 2.6.18-6-amd64 PHP Version: 5.2.9 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php $v['tm_year'] contains the years since 1900. Previous Comments: ------------------------------------------------------------------------ [2009-06-03 10:52:32] post at oliver-schieche dot de Description: ------------ Trying to get mktime to create a timestamp for today at 00:00 hours, odd results are returned. Previous versions of PHP 5 returned a correct timestamp even without adding 1900 to the year. This change to mktime behavior was not documented in the ChangeLog. Reproduce code: --------------- $v = localtime(time(), TRUE); $tm1 = mktime(0, 0, 0, $v['tm_mon']+1, $v['tm_mday'], $v['tm_year']); $tm2 = mktime(0, 0, 0); Expected result: ---------------- tm1 == tm2 == 1243980000 // 2009-06-03 00:00:00 Actual result: -------------- tm1 = -58714246800 tm2 = 1243980000 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48458&edit=1
