|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #69661 date_parse says the day is 1 instead of false
Submitted: 2015-05-19 11:17 UTC Modified: 2015-05-19 11:54 UTC
Avg. Score:2.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: php-bugs at xpaw dot me Assigned:
Status: Verified Package: Date/time related
PHP Version: 5.6.9 OS: Ubuntu
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-05-19 11:17 UTC] php-bugs at xpaw dot me
I don't know if this is expected behaviour or not, but parsing a date without a day, will produce a result where 'day' will be set to 1. If this is expected, there really should be a parameter that disables this. I'm using this for user provided data, and it's not really valid.

Test script:
var_dump(date_parse("May 2013"));

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-05-19 11:54 UTC]
-Status: Open +Status: Verified
 [2015-05-19 11:54 UTC]
See also <>.
 [2017-01-04 17:04 UTC] contact at frank-liepert dot de
This is expected behaviour, see "Textual month and four digit year (Day reset to 1)" on
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC