|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80022 Inconsistency DateTimeInterface::ISO8601
Submitted: 2020-08-26 21:40 UTC Modified: 2020-08-27 06:57 UTC
From: pablo at antweb dot es Assigned:
Status: Closed Package: Date/time related
PHP Version: 7.4.9 OS:
Private report: No CVE-ID: None
 [2020-08-26 21:40 UTC] pablo at antweb dot es
In we have 

const string DateTimeInterface::ISO8601 = "Y-m-d\TH:i:sO" ;

The format 0 = Difference to Greenwich time (GMT) without colon between hours and minutes 	Example: +0200 (

But the format('c') full date/time define:
c 	ISO 8601 date (added in PHP 5) 	2004-02-12T15:19:21+00:00

We can to see that the format is inconsistency, format "c" is not equal to Y-m-d\TH:i:sO it would be 2004-02-12T15:19:21+0000


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-08-26 23:12 UTC]
-Status: Open +Status: Feedback -Package: Documentation problem +Package: Date/time related
 [2020-08-26 23:12 UTC]
That's right, 'O' does not have a colon while the timezone offset in 'c' does.

What bug are you reporting?
 [2020-08-27 06:51 UTC] pablo at antweb dot es
-Status: Feedback +Status: Open
 [2020-08-27 06:51 UTC] pablo at antweb dot es
This is the inconsistency.

Format "c" is a ISO 8601 date and have colon, and DateTimeInterface:ISO8601 = "Y-m-d\TH:i:sO" but does not have colon...
 [2020-08-27 06:55 UTC]
-Status: Open +Status: Not a bug
 [2020-08-27 06:55 UTC]
> Note: This format is not compatible with ISO-8601, but is left this way for
> backward compatibility reasons. Use DateTime::ATOM or DATE_ATOM for
> compatibility with ISO-8601 instead.
 [2020-08-27 06:57 UTC] pablo at antweb dot es
Mystery solved ... thank you.
 [2022-07-22 14:37 UTC]
Automatic comment on behalf of derickr
Log: Fixed bug #80022: Support ISO 8601 years outside 0000-9999 range better
 [2022-07-22 14:37 UTC]
-Status: Not a bug +Status: Closed
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Aug 10 18:05:46 2022 UTC