php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #23139 strtotime() fails to parse specific date
Submitted: 2003-04-09 13:46 UTC Modified: 2003-08-17 17:02 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: david at acz dot org Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.3.2RC1 OS: FreeBSD 4.8
Private report: No CVE-ID: None
 [2003-04-09 13:46 UTC] david at acz dot org
strtotime() cannot parse the following date:

Tue Apr 1 04:52:01 2003

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-09 16:17 UTC] 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 16:52 UTC] 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 21:50 UTC] 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-14 19:50 UTC] iliaa@php.net
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.
 [2003-08-17 17:02 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, 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/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC