Bug #66019 [Opn->Asn]: DateTime object does not support short ISO 8601 time format - YYYY-MM-DDTHH
Edit report at https://bugs.php.net/bug.php?id=66019&edit=1
ID: 66019
Updated by: felipe@php.net
Reported by: kaldari at gmail dot com
Summary: DateTime object does not support short ISO 8601 time
format - YYYY-MM-DDTHH
-Status: Open
+Status: Assigned
Type: Bug
Package: Date/time related
Operating System: MacOS X
PHP Version: 5.5.5
-Assigned To:
+Assigned To: derick
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2013-11-02 00:25:39] kaldari at gmail dot com
Description:
------------
According to ISO 8601, the following is a valid date-time representation:
2012-02-02T10
(representing 2 February 2012, 10:00)
However, PHP throws an error if the minutes are not specified.
Test script:
---------------
$tz = new DateTimeZone("Europe/Amsterdam");
$dateObject = new DateTime( '2012-02-02T10', $tz );
echo $dateObject->format( 'j F Y H:i' );
Expected result:
----------------
2 February 2012 10:00
Actual result:
--------------
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct():
Failed to parse time string (2012-02-02T10) at position 11 (1): Unexpected character'
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66019&edit=1
Thread (8 messages)