#40290 [NEW]: strtotime() returns unexpected result with particular timezone offset

From: Date: Tue, 30 Jan 2007 20:35:24 +0000
Subject: #40290 [NEW]: strtotime() returns unexpected result with particular timezone offset
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-108261@lists.php.net to get a copy of this message
From: patrick at papaq dot org Operating system: Win32/CentOS/Fedora PHP version: 5.2.0 PHP Bug Type: Date/time related Bug description: strtotime() returns unexpected result with particular timezone offset Description: ------------ When using strtotime() to parse a date string with a certain timezone offset it returns an incorrect result. I got this kind of a timezone "Tue, 30 Jan 2007 12:27:00 +0001" from an rss feed. Although they actually mean "+0100" strtotime() should return a time with one minute difference, not 1 month. Reproduce code: --------------- <?php putenv('TZ=Pacific/Auckland'); echo date("Y-m-d H:i:s\n",strtotime("Tue, 30 Jan 2007 12:27:00 +0001")); ?> Expected result: ---------------- 2007-01-31 01:26:00 Actual result: -------------- 2007-03-04 13:27:00 -- Edit bug report at http://bugs.php.net/?id=40290&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40290&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40290&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40290&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40290&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40290&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40290&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40290&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40290&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40290&r=support Expected behavior: http://bugs.php.net/fix.php?id=40290&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40290&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40290&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40290&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40290&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40290&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40290&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40290&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40290&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40290&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40290&r=mysqlcfg

« previous php.bugs (#108261) next »