ID:               36598
 Updated by:       [EMAIL PROTECTED]
 Reported By:      d dot begley at uws dot edu dot au
 Status:           Open
 Bug Type:         Documentation problem
 Operating System: *
 PHP Version:      Irrelevant
 New Comment:

You don't have to document bugs like this...


Previous Comments:
------------------------------------------------------------------------

[2006-03-04 02:52:35] [EMAIL PROTECTED]

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] [EMAIL PROTECTED]

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

Reply via email to