#26694 [Asn->Csd]: strtotime fails on 'Sun, 21 Dec 2003 20:38:33 +0000 GMT'

From: Date: Mon, 20 Jun 2005 07:23:23 +0000
Subject: #26694 [Asn->Csd]: strtotime fails on 'Sun, 21 Dec 2003 20:38:33 +0000 GMT'
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-80671@lists.php.net to get a copy of this message
ID: 26694 Updated by: derick@php.net Reported By: phpbug at thequod dot de -Status: Assigned +Status: Closed Bug Type: Feature/Change Request Operating System: Windows XP PHP Version: 4.3.4 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. Fixed for PHP 5.1. Previous Comments: ------------------------------------------------------------------------ [2004-08-05 00:21:15] joelgphp at gadgetwiz dot com The "+0000 GMT" format is also used by the Blackberry email client[s]. I've opened a ticket with them to fix the problem; however, because the issue seems to keep coming up, it should be parsed by the strtotime function even if it is not technically compliant. ------------------------------------------------------------------------ [2004-04-25 11:39:00] derick@php.net That doesn't mean we can't support it :) ------------------------------------------------------------------------ [2003-12-22 16:52:53] eru@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php You can either define the timezone by +dddd or by the 3-char identifier of that timezone. Your format isn\'t defined by the syntax - for further readings see http://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html ------------------------------------------------------------------------ [2003-12-22 13:29:16] phpbug at thequod dot de summary: it fails on $d = gmdate("r") . ' GMT'; var_dump( strtotime($d) ); ------------------------------------------------------------------------ [2003-12-22 12:46:58] phpbug at thequod dot de Description: ------------ I use strtotime to decode the If-Modified-Since header and just noticed that Firebird puts and offset in front of the "GMT". I don't know if this is RFC conform, but it should be recognized by strtotime(), IMHO. Reproduce code: --------------- var_dump(strtotime('Sun, 21 Dec 2003 20:38:33 +0000 GMT')); Expected result: ---------------- -1 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=26694&edit=1

« previous php.bugs (#80671) next »