|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-01-16 00:59 UTC] rasmus@php.net
-Status: Open
+Status: Not a bug
[2016-01-16 00:59 UTC] rasmus@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 06 15:00:01 2026 UTC |
Description: ------------ strtotime is returning the same value for "2016-03-13 02:00:00" and "2016-03-13 03:00:00". The resulting date() is incorrect when the hour is 2. During this hour the 3600 seconds that would be added to strtotime is skipped. Test script: --------------- for($i=0;$i<10;$i++){ echo strtotime('2016-03-13 0'.$i.':00:00'); echo '<br>'; echo date('g:i A',strtotime('2016-03-13 0'.$i.':00:00')); echo '<br>'; } Expected result: ---------------- 1457848800 12:00 AM 1457852400 1:00 AM 1457856000 2:00 AM 1457859600 3:00 AM 1457863200 4:00 AM 1457866800 5:00 AM 1457870400 6:00 AM 1457874000 7:00 AM 1457877600 8:00 AM 1457881200 9:00 AM Actual result: -------------- 1457848800 12:00 AM 1457852400 1:00 AM 1457856000 (correct strtotime value) 3:00 AM (incorrect hour value from date) 1457856000 (strtotime skips 3600 seconds) 3:00 AM 1457859600 4:00 AM 1457863200 5:00 AM 1457866800 6:00 AM 1457870400 7:00 AM 1457874000 8:00 AM 1457877600 9:00 AM