#23139 [Opn]: strtotime() fails to parse specific date

From: Date: Tue, 15 Apr 2003 00:50:28 +0000
Subject: #23139 [Opn]: strtotime() fails to parse specific date
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37671@lists.php.net to get a copy of this message
ID: 23139 Updated by: iliaa@php.net Reported By: david at acz dot org Status: Open -Bug Type: Date/time related +Bug Type: Feature/Change Request Operating System: FreeBSD 4.8 PHP Version: 4.3.2RC1 New Comment: strtotime() support MANY date formats, but it is by no means omnipotent and cannot support any date format imagined. I am marking this is a feature request for when someone decides to rewrite the strtotime() date parser. Previous Comments: ------------------------------------------------------------------------ [2003-04-09 21:50:42] david at acz dot org I received that date in a "Date" header in an email (from SpamCop). strtotime() is the only function available in PHP to parse arbitrary dates. As such, it would be very useful if it did a better job with dates in weird formats. I wrote a fallback parser that works by examining each element of the date and determining what part of the date it could be (month, day, time, etc.). I would be happy to use this method to extend strtotime(), or add another function, such as parsetime(). Would such a contribution be added to PHP? I expect strtotime() to be able to parse any date that I can. This is possible with a few heuristics. ------------------------------------------------------------------------ [2003-04-09 16:52:38] sniper@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. . ------------------------------------------------------------------------ [2003-04-09 16:17:03] michael dot mauch at gmx dot de Does it work for you with any other date/time in your format, i.e. with the time in the middle of the date? It doesn't here, neither with 4.3.2-RC nor with 4.2.3, and I didn't find any reference to that format in the manual, so I guess strtotime() is not meant to be used with such a format. ------------------------------------------------------------------------ [2003-04-09 13:46:24] david at acz dot org strtotime() cannot parse the following date: Tue Apr 1 04:52:01 2003 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23139&edit=1

« previous php.bugs (#37671) next »