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

From: Date: Thu, 10 Apr 2003 02:50:43 +0000
Subject: #23139 [Bgs->Opn]: strtotime() fails to parse specific date
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37508@lists.php.net to get a copy of this message
ID: 23139 User updated by: david at acz dot org Reported By: david at acz dot org -Status: Bogus +Status: Open Bug Type: Date/time related Operating System: FreeBSD 4.8 PHP Version: 4.3.2RC1 New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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 (#37508) next »