Doc #70115 [Opn]: DATE_ISO8601 const not compatible with ISO standard
| From: | derick@php.net | Date: | Thu, 23 Jul 2015 08:19:56 +0000 |
| Subject: | Doc #70115 [Opn]: DATE_ISO8601 const not compatible with ISO standard | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12542@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70115&edit=1
ID: 70115
Updated by: derick@php.net
Reported by: adambro at o2 dot pl
Summary: DATE_ISO8601 const not compatible with ISO standard
Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: N/A
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
But we can't change the constant, so it needs to be documented.
Previous Comments:
------------------------------------------------------------------------
[2015-07-22 14:52:46] cmb@php.net
Not sure, if that is a *documentation* problem. The format "c" is
properly described as "ISO 8601 date", but DATE_ISO8601 works
slightly different. That is inconsistent at best.
------------------------------------------------------------------------
[2015-07-22 14:13:20] adambro at o2 dot pl
Expected result:
Add a warning in documentation that DATE_ISO8601 is not compatible with that standard, hence other
languages (Java, JS).
------------------------------------------------------------------------
[2015-07-22 14:11:25] adambro at o2 dot pl
Description:
------------
---
From manual page: http://www.php.net/class.datetime
---
The constant DATE_ISO8601 is not compatible with ISO standard. The standard says in extended format
(with colons) everything has to be in that notation, so having timezone represented as
"+0000" (O in const string) is invalid. It should be "+00:00" (P in const).
There's a #55272 bug, but it was closed due to wrong premise that basic format can be mixed
with extended one.
It is being explained in the comment already:
http://php.net/manual/en/class.datetime.php#116085
Using date("c") yields correct format, also DATE_RFC3339 seem to be compatible.
I've stumbled upon the bug while exchanging data with Java system.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70115&edit=1