Req #51472 [Asn->Wfx]: DateTime::createFromFormat() does not accept 'W' or 'w' format specifier
Edit report at https://bugs.php.net/bug.php?id=51472&edit=1
ID: 51472
Updated by: derick@php.net
Reported by: wmbr at cust dot in
Summary: DateTime::createFromFormat() does not accept 'W' or
'w' format specifier
-Status: Assigned
+Status: Wont fix
Type: Feature/Change Request
Package: Date/time related
Operating System: ubuntu
PHP Version: 5.3.2
Assigned To: derick
Block user comment: N
Private report: N
New Comment:
I am marking this as "Won't Fix". If this is still an issue, please open a new ticket
at https://github.com/php/php-src/issues/
The documentation has been updated (a long time ago) to say:
In most cases, the same letters as for the date() can be used.
Previous Comments:
------------------------------------------------------------------------
[2011-05-03 10:02:43] 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 !
------------------------------------------------------------------------
[2010-04-04 18:30:55] 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());
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=51472&edit=1
Thread (3 messages)