Req #76009 [Opn]: Cant parse v
| From: | derick@php.net | Date: | Mon, 26 Feb 2018 07:25:42 +0000 |
| Subject: | Req #76009 [Opn]: Cant parse v | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214106@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76009&edit=1
ID: 76009
Updated by: derick@php.net
Reported by: rparker at kodama dot design
Summary: Cant parse v
Status: Open
Type: Feature/Change Request
Package: Date/time related
Operating System: Windows
PHP Version: 7.1.14
Block user comment: N
Private report: N
New Comment:
Looks like this got missed out when we added 'v' to formatting. However, this has recently
been added to timelib (the library behind the functionality). Parsing 'v' should make it
into PHP 7.3.
Previous Comments:
------------------------------------------------------------------------
[2018-02-26 01:18:08] rparker at kodama dot design
Description:
------------
\DateTime::createFromFormat('Y-m-d\TH:i:sP',
'2015-06-09T14:00:00-07:00') works but
\DateTime::createFromFormat('Y-m-d\TH:i:s.vP',
'2015-06-09T14:00:00.000-07:00') doesnt.
var_dump(\DateTime::getLastErrors()) outputs array(4) {
["warning_count"]=> int(0) ["warnings"]=> array(0) { }
["error_count"]=> int(2) ["errors"]=> array(2) { [26]=> string(35)
"The format separator does not match" [27]=> string(13) "Trailing data" }
}
It is being triggered by the v option which should be supported.
Test script:
---------------
\DateTime::createFromFormat('Y-m-d\TH:i:s.vP', '2015-06-09T14:00:00.000-07:00');
var_dump(\DateTime::getLastErrors());
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76009&edit=1