#40290 [Asn->Csd]: strtotime() returns unexpected result with particular timezone offset

From: Date: Fri, 13 Apr 2007 08:11:42 +0000
Subject: #40290 [Asn->Csd]: strtotime() returns unexpected result with particular timezone offset
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-111440@lists.php.net to get a copy of this message
ID: 40290 Updated by: derick@php.net Reported By: patrick at papaq dot org -Status: Assigned +Status: Closed Bug Type: Date/time related Operating System: Win32/CentOS/Fedora PHP Version: 5.2.0 Assigned To: derick New Comment: This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2007-01-30 20:35:24] patrick at papaq dot org 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 this bug report at http://bugs.php.net/?id=40290&edit=1

« previous php.bugs (#111440) next »