#47184 [Opn->Bgs]: DATE_ISO8601 constant and date('c') mismatch

From: Date: Thu, 22 Jan 2009 14:34:57 +0000
Subject: #47184 [Opn->Bgs]: DATE_ISO8601 constant and date('c') mismatch
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-133155@lists.php.net to get a copy of this message
ID: 47184 Updated by: iliaa@php.net Reported By: guilhermeblanco@php.net -Status: Open +Status: Bogus Bug Type: Date/time related Operating System: * PHP Version: 5.2.8 New Comment: One is basic and the other is extended format, both are valid. Previous Comments: ------------------------------------------------------------------------ [2009-01-21 17:07:06] guilhermeblanco@php.net Description: ------------ Following the documentation, DATE_ISO8601 contains this syntax: 2005-08-15T15:52:01+0000 Also, date('c') documents that: ISO 8601 date (added in PHP 5) 2004-02-12T15:19:21+00:00 We should keep consistency when supporting this spec. I propose the change then to DATE_ISO8601 constant, defined in ext/date/php_date.c, line 714: - #define DATE_FORMAT_ISO8601 "Y-m-d\\TH:i:sO" + #define DATE_FORMAT_ISO8601 "Y-m-d\\TH:i:sP" Reproduce code: --------------- echo DATE_ISO8601 === date('c') ? 'true' : 'false'; Expected result: ---------------- true Actual result: -------------- false ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47184&edit=1

« previous php.bugs (#133155) next »