#49534 [NEW]: Incorrect dates returned with strtotime
| From: | re dot lewis at comcast dot net | Date: | Fri, 11 Sep 2009 19:21:03 +0000 |
| Subject: | #49534 [NEW]: Incorrect dates returned with strtotime | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-142262@lists.php.net to get a copy of this message | ||
From: re dot lewis at comcast dot net
Operating system: Linux
PHP version: 5.2.10
PHP Bug Type: Date/time related
Bug description: Incorrect dates returned with strtotime
Description:
------------
On Sept 11, 2009 I was calculating the date for each successive sunday and
used the code below, but after Nov 1, 2009, the day changes to Saturday.
Is this a bug? It appears to be related to daylight savings time.
Reproduce code:
---------------
<?php
for ($w= 5; $w < 15; $w++) {
echo date('Y-m-d, D, z', (strtotime('sunday') + $w*7*24*60*60)) .
"<br>";
}
?>
Expected result:
----------------
Return the date of each sunday starting 5 weeks from this coming sunday.
Actual result:
--------------
2009-10-18, Sun, 290
2009-10-25, Sun, 297
2009-11-01, Sun, 304
2009-11-07, Sat, 310
2009-11-14, Sat, 317
2009-11-21, Sat, 324
2009-11-28, Sat, 331
2009-12-05, Sat, 338
2009-12-12, Sat, 345
2009-12-19, Sat, 352
--
Edit bug report at http://bugs.php.net/?id=49534&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49534&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49534&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49534&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49534&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49534&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49534&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49534&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49534&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49534&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49534&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49534&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49534&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49534&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49534&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49534&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49534&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49534&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49534&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49534&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49534&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49534&r=mysqlcfg