|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-01-12 06:38 UTC] requinix@php.net
-Type: Bug
+Type: Feature/Change Request
[2016-01-12 08:43 UTC] salsi at icosaedro dot it
[2016-06-14 11:18 UTC] mkroese at eljakim dot nl
[2020-11-09 11:24 UTC] jan dot espen dot oversand at cerpus dot com
[2022-05-20 13:28 UTC] derick@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: derick
[2022-05-20 13:28 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 02:00:01 2025 UTC |
Description: ------------ DateTime::__construct cannot parse [W3] datetime format with fraction of second has more than **9** digits. E.g. new \DateTime("2016-01-01T01:02:03.123456789-01:02"); will fail, while new \DateTime("2016-01-01T01:02:03.12345678-01:02"); is ok. Tried PHP version: 5.5.26 and 7.0.2 Tried OS: CentOS 6.7, openSUSE Tumbleweed, Windows 7 --- [W3]: http://www.w3.org/TR/NOTE-datetime-970915 Test script: --------------- <?php $w3 = new \DateTime("2016-01-01T01:02:03.123456789-01:02"); echo $w3->format("Y-m-d\TH:i:s.uP"); Expected result: ---------------- (No exception throw!) 2016-01-01T01:02:03.123457-01:02 Actual result: -------------- PHP Warning: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (2016-01-01T01:02:03.123456789-01:02) at position 0 (2): The timezone could not be found in the database' in php shell code:1