|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40290 strtotime() returns unexpected result with particular timezone offset
Submitted: 2007-01-30 20:35 UTC Modified: 2007-04-13 08:11 UTC
From: patrick at papaq dot org Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5.2.0 OS: Win32/CentOS/Fedora
Private report: No CVE-ID: None
 [2007-01-30 20:35 UTC] patrick at papaq dot org
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:
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-13 08:11 UTC]
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
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 08 13:03:53 2023 UTC