Bug #71383 [NEW]: strtotime(), date() skip hour in "2016-03-13 02:00:00" & "2016-03-13 03:00:00"
| From: | traci at jbsystemsllc dot com | Date: | Fri, 15 Jan 2016 22:36:26 +0000 |
| Subject: | Bug #71383 [NEW]: strtotime(), date() skip hour in "2016-03-13 02:00:00" & "2016-03-13 03:00:00" | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-198697@lists.php.net to get a copy of this message | ||
From: traci at jbsystemsllc dot com
Operating system: OS x 10.8.5
PHP version: 5.5.31
Package: Date/time related
Bug Type: Bug
Bug description:strtotime(), date() skip hour in "2016-03-13 02:00:00" &
"2016-03-13 03:00:00"
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
--
Edit bug report at https://bugs.php.net/bug.php?id=71383&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71383&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71383&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71383&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71383&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71383&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71383&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71383&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71383&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71383&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71383&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71383&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71383&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71383&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71383&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71383&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71383&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71383&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71383&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71383&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71383&r=mysqlcfg