|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-07-13 11:26 UTC] houweling dot frank at gmail dot com
-Status: Open
+Status: Closed
[2016-07-13 11:26 UTC] houweling dot frank at gmail dot com
[2020-09-23 07:21 UTC] kylekatarnls at gmail dot com
[2020-09-23 08:35 UTC] salathe@php.net
-Status: Closed
+Status: Re-Opened
-Type: Bug
+Type: Feature/Change Request
-Package: Unknown/Other Function
+Package: Date/time related
[2020-09-23 08:35 UTC] salathe@php.net
[2022-06-05 13:48 UTC] derick@php.net
-Status: Re-Opened
+Status: Wont fix
[2022-06-05 13:48 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 12:00:01 2025 UTC |
Description: ------------ I have tested this bug on Windows / Linux and PHP versions 5.5 and 7.0. The DateTime::createFromFormat function does not correctly use the ISO 8601 modifier ('c'). Trying to parse an ISO 8601 datetime string using this function results in 'false'. Test script: --------------- <?php // Create datetime $date = new \DateTime('now'); var_dump($date); // = DateTime Object // Convert to string $fDate = $date->format('c'); var_dump($fDate); // = ISO 8601 string // Read data to object $rDate = \DateTime::createFromFormat('c', $fDate); var_dump($rDate); // = false Expected result: ---------------- \DateTime::createFromFormat('c', $fDate); should result in a valid DateTime object, with the same contents as the original $date object. Actual result: -------------- False, the createFromFormat function cannot parse the string