#35218 [Asn->Csd]: strtotime no longer ignores timezone comments like (EST)

From: Date: Thu, 17 Nov 2005 13:09:57 +0000
Subject: #35218 [Asn->Csd]: strtotime no longer ignores timezone comments like (EST)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-88383@lists.php.net to get a copy of this message
ID: 35218 Updated by: derick@php.net Reported By: chagenbu@php.net -Status: Assigned +Status: Closed Bug Type: Date/time related Operating System: Debian 3.1/Kernel 2.6.7 PHP Version: 5.1.0RC4 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: ------------------------------------------------------------------------ [2005-11-14 19:57:35] tony2001@php.net Assigned to the author of this part. ------------------------------------------------------------------------ [2005-11-14 18:28:03] chagenbu@php.net Description: ------------ A number of mail clients or mail generating scripts generate Date: headers that use the following format: Sun, 13 Nov 2005 22:56:10 -0800 (PST) The final part - " (PST)" is not required (and probably technically invalid) by the date format described in RFC 2822, however, it's also probably valid as a header comment. Prior to the 5.1 branch, PHP's strtotime simply ignored comments in this style; however, with 5.1, it causes strtotime to fail and return false. Valid or invalid I think it'd be good for PHP to ignore these and just parse the rest of the date. Reproduce code: --------------- <?php $date = 'Sun, 13 Nov 2005 22:56:10 -0800 (PST)'; $date_fixed = 'Sun, 13 Nov 2005 22:56:10 -0800'; var_dump(strtotime($date)); var_dump(strtotime($date_fixed)); Expected result: ---------------- int(1131951370) int(1131951370) Actual result: -------------- bool(false) int(1131951370) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35218&edit=1

« previous php.bugs (#88383) next »