php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #70115 DATE_ISO8601 const not compatible with ISO standard
Submitted: 2015-07-22 14:11 UTC Modified: 2015-08-27 14:14 UTC
From: adambro at o2 dot pl Assigned: cmb (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: N/A
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: adambro at o2 dot pl
New email:
PHP Version: OS:

 

 [2015-07-22 14:11 UTC] 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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-22 14:13 UTC] 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:52 UTC] 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-23 08:19 UTC] derick@php.net
But we can't change the constant, so it needs to be documented.
 [2015-08-27 14:13 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=337646
Log: DATE_ISO8601 is not compatible with ISO-8601 (fixes #70115)
 [2015-08-27 14:14 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2015-08-27 14:14 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 11:01:29 2024 UTC