#36598 [Opn->Csd]: incorrect example for date() constant
| From: | nlopess@php.net | Date: | Mon, 06 Mar 2006 22:52:41 +0000 |
| Subject: | #36598 [Opn->Csd]: incorrect example for date() constant | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969372253@lists.php.net to get a copy of this message | ||
ID: 36598
Updated by: nlopess@php.net
Reported By: d dot begley at uws dot edu dot au
-Status: Open
+Status: Closed
Bug Type: Documentation problem
Operating System: *
PHP Version: Irrelevant
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2006-03-04 13:15:33] derick@php.net
You don't have to document bugs like this...
------------------------------------------------------------------------
[2006-03-04 02:52:35] bjori@php.net
I've kinda been expecting reports like this.
We'll need to document the changed behaviour.
Something along the lines of this patch maybe..
http://php.is/bugs/36598/phpdoc.datetime.patch.txt
Index: constants.xml
===================================================================
RCS file: /repository/phpdoc/en/reference/datetime/constants.xml,v
retrieving revision 1.6
diff -u -r1.6 constants.xml
--- constants.xml 31 Jan 2006 21:10:31 -0000 1.6
+++ constants.xml 4 Mar 2006 01:39:00 -0000
@@ -17,6 +17,9 @@
<simpara>
Atom (example: 2005-08-15T15:52:01+00:00)
</simpara>
+ <note>
+ <para>Prior to PHP5.1.3 DATE_ATOM didn't have colon in the
timezone offset</para>
+ </note>
</listitem>
</varlistentry>
<varlistentry>
@@ -114,8 +117,11 @@
</term>
<listitem>
<simpara>
- World Wide Web Consortium (example: 2005-08-15T15:52:01+0000)
+ World Wide Web Consortium (example: 2005-08-15T15:52:01+00:00)
</simpara>
+ <note>
+ <para>Prior to PHP5.1.3 DATE_W3C didn't have colon in the
timezone offset</para>
+ </note>
</listitem>
</varlistentry>
</variablelist>
------------------------------------------------------------------------
[2006-03-03 08:46:31] derick@php.net
The documentation for DATE_ATOM is correct, the one for DATE_W3C isn't.
I will fix the code in a bit too.
------------------------------------------------------------------------
[2006-03-03 06:06:51] d dot begley at uws dot edu dot au
Description:
------------
The documentation for date() gives a number of examples for the new
constants added in PHP 5.1.1:
http://www.php.net/manual/en/ref.datetime.php
The first example:
DATE_ATOM (string)
Atom (example: 2005-08-15T15:52:01+00:00)
is incorrect - the actual output has no colon in the timezone offset
(though I believe one is missing from the W3C format, though I'll file
a separate bug for that).
Reproduce code:
---------------
Simple function call:
date( DATE_ATOM, getlastmod() )
produces output of the form:
2006-03-03T15:41:46+1100
which according to the documentation should be:
2006-03-03T15:41:46+11:00
(ie., colon in timezone offset). The documentation and code are
inconsistent.
Expected result:
----------------
See "reproduce code" section; expected output (as per documentation)
is:
2006-03-03T15:41:46+11:00
Actual result:
--------------
See "reproduce code" section; actual result is:
2006-03-03T15:41:46+1100
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36598&edit=1