php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48424 strtotime changes year to current year with date formatted "17 July, 2004"
Submitted: 2009-05-29 04:36 UTC Modified: 2009-05-29 13:34 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: php at qrs dot oib dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.*, 6CVS (2009-05-29) OS: *
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at qrs dot oib dot com
New email:
PHP Version: OS:

 

 [2009-05-29 04:36 UTC] php at qrs dot oib dot com
Description:
------------
strtotime changes the year to the current year with a date formatted like "17 July, 2004".

Reproduce code:
---------------
print strftime("%d %B, %Y", strtotime("July 17, 2004"));
print strftime("%d %B, %Y", strtotime("17 July, 2004")); // <---
print strftime("%d %B, %Y", strtotime("17 July 2004"));

Expected result:
----------------
17 July, 2004
17 July, 2004
17 July, 2004

Actual result:
--------------
17 July, 2004
17 July, 2009
17 July, 2004

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-29 12:48 UTC] derick@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

THis is how the parser works, check with var_dump(date_parse("17 July, 2004"));
 [2009-05-29 13:34 UTC] rasmus@php.net
So, fix the parser.  Why would "July 17, 2004" pick up the year while "17 July, 2004" doesn't?
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 19:01:32 2024 UTC