php.net |  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
Votes:4
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
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: wmbr at cust dot in
New email:
PHP Version: OS:

 

 [2010-04-04 18:30 UTC] wmbr at cust dot in
Description:
------------
Although the documentation claims every "Format accepted by date()" is accepted by DateTime::createFromFormat() (http://www.php.net/manual/en/datetime.createfromformat.php), 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');
print_r(DateTime::getLastErrors());


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-04 23:47 UTC] derick@php.net
-Package: Date/time related +Package: Documentation problem
 [2010-04-17 15:13 UTC] derick@php.net
-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] derick@php.net
-Type: Bug +Type: Feature/Change Request
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC