ID: 46211 User updated by: cmt042 at motorola dot com Reported By: cmt042 at motorola dot com Status: Bogus Bug Type: Date/time related Operating System: UNIX PHP Version: 5.2.6 New Comment:
Can you have a close look at the actual and expected result? The DST change does make the 3rd role in the Actual result right. But it's the 4th role and 5 role which is not right, as I mentioned in the expected result. Time should not freeze for one hour after changed in DST. The DST website did not mention this rule at all. Here is the printout of the return of strtotime function. 1236493432 1236497032 1236500632 1236500632 //one hour lost. expected is 1236500632+ 3600 1236504232 //same here The absolute time value should not be affected by DST. Previous Comments: ------------------------------------------------------------------------ [2008-10-01 23:56:47] [EMAIL PROTECTED] We are happy to tell you that you just discovered Daylight Savings Time. For more information see: http://webexhibits.org/daylightsaving/b.html Instead of using mktime/date consider using gmmktime and gmdate which do not suffer from DST. ------------------------------------------------------------------------ [2008-10-01 15:19:04] cmt042 at motorola dot com Description: ------------ When DST changes, the strtotime function give back wrong result. Reproduce code: --------------- // Need to adjust the day or hour numbers when run the code to make it cross the DST, Mar 8th 2:00AM 2009 $output = array(); for ($i = 15; $i <=19; $i++) { $t = strtotime("+157 days +${i} hours"); $output[] = date("r",$t); } foreach ($output as $line) print $line . "\n"; Expected result: ---------------- Sun, 08 Mar 2009 00:54:09 -0600 Sun, 08 Mar 2009 01:54:09 -0600 Sun, 08 Mar 2009 03:54:09 -0500 Sun, 08 Mar 2009 04:54:09 -0500 Sun, 08 Mar 2009 05:54:09 -0500 Actual result: -------------- Sun, 08 Mar 2009 00:54:09 -0600 Sun, 08 Mar 2009 01:54:09 -0600 Sun, 08 Mar 2009 03:54:09 -0500 Sun, 08 Mar 2009 03:54:09 -0500 Sun, 08 Mar 2009 04:54:09 -0500 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46211&edit=1