php.net |  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
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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-13 08:11 UTC] derick@php.net
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.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC