|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-10-01 23:56 UTC] jani@php.net
[2008-10-03 15:46 UTC] cmt042 at motorola dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 05:00:01 2025 UTC |
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