|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #51472 DateTime::createFromFormat() does not accept 'W' or 'w' format specifier
Submitted: 2010-04-04 18:30 UTC Modified: 2017-02-12 20:40 UTC
Avg. Score:3.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:0 (0.0%)
From: wmbr at cust dot in Assigned: derick (profile)
Status: Assigned Package: Date/time related
PHP Version: 5.3.2 OS: ubuntu
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-04-04 18:30 UTC] wmbr at cust dot in
Although the documentation claims every "Format accepted by date()" is accepted by DateTime::createFromFormat() (, the specifiers 'W' and 'w' are actually not.
So this is either a bug or a documentation-error.

Test script:
$mydate = DateTime::createFromFormat('W', '1');


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-04 23:47 UTC]
-Package: Date/time related +Package: Documentation problem
 [2010-04-17 15:13 UTC]
-Package: Documentation problem +Package: Date/time related -Assigned To: +Assigned To: derick
 [2011-05-03 10:02 UTC] sjaillet at gmail dot com
This missing feature (of w at least) requires parsing the english textual representation of days for localizing it. Obtaining an index would be much more efficient !
 [2017-02-12 20:40 UTC]
-Type: Bug +Type: Feature/Change Request
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 18 18:03:40 2021 UTC