[PATCH] New date() format character, "P", DATE_ATOM constant changes
| From: | Hannes Magnusson | Date: | Tue, 31 Jan 2006 21:06:15 +0000 |
| Subject: | [PATCH] New date() format character, "P", DATE_ATOM constant changes | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969371793@lists.php.net to get a copy of this message | ||
As of PHP5.1.3 there is new format character for date(), "P", and the
DATE_ATOM constant has been changed to be RFC3339 compliant.
See: http://news.php.net/php.cvs/36705
...And those constants were added in 5.1.1, not 5.1.0 (they were class
constants in 5.1.0).
Patch attached.
- Hannes
Index: constants.xml =================================================================== RCS file: /repository/phpdoc/en/reference/datetime/constants.xml,v retrieving revision 1.5 diff -u -r1.5 constants.xml --- constants.xml 29 Nov 2005 09:25:11 -0000 1.5 +++ constants.xml 31 Jan 2006 20:59:44 -0000 @@ -15,7 +15,7 @@ </term> <listitem> <simpara> - Atom (example: 2005-08-15T15:52:01+0000) + Atom (example: 2005-08-15T15:52:01+00:00) </simpara> </listitem> </varlistentry> Index: functions/date.xml =================================================================== RCS file: /repository/phpdoc/en/reference/datetime/functions/date.xml,v retrieving revision 1.27 diff -u -r1.27 date.xml --- functions/date.xml 29 Nov 2005 09:25:12 -0000 1.27 +++ functions/date.xml 31 Jan 2006 20:59:44 -0000 @@ -21,7 +21,7 @@ </para> <tip> <para> - Since PHP 5.1.0 there are a couple of useful <link + Since PHP 5.1.1 there are a couple of useful <link linkend="datetime.constants">constants</link> of standard date/time formats that can be used to specify the <parameter>format</parameter> parameter. @@ -252,6 +252,11 @@ <entry>Example: <literal>+0200</literal></entry> </row> <row> + <entry><literal>P</literal></entry> + <entry>Difference to Greenwich time (GMT) with colon between hours and minutes (added in PHP 5.1.3)</entry> + <entry>Example: <literal>+02:00</literal></entry> + </row> + <row> <entry><literal>T</literal></entry> <entry>Timezone setting of this machine</entry> <entry>Examples: <literal>EST</literal>, <literal>MDT</literal> ...</entry> @@ -314,7 +319,7 @@ // prints something like: Mon, 15 Aug 2005 15:12:46 UTC echo date(DATE_RFC822); -// prints something like: 2000-07-01T00:00:00+0000 +// prints something like: 2000-07-01T00:00:00+00:00 echo date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000)); ?> ]]>
Index: constants.xml =================================================================== RCS file: /repository/phpdoc/en/reference/datetime/constants.xml,v retrieving revision 1.5 diff -u -r1.5 constants.xml --- constants.xml 29 Nov 2005 09:25:11 -0000 1.5 +++ constants.xml 31 Jan 2006 20:59:44 -0000 @@ -15,7 +15,7 @@ </term> <listitem> <simpara> - Atom (example: 2005-08-15T15:52:01+0000) + Atom (example: 2005-08-15T15:52:01+00:00) </simpara> </listitem> </varlistentry> Index: functions/date.xml =================================================================== RCS file: /repository/phpdoc/en/reference/datetime/functions/date.xml,v retrieving revision 1.27 diff -u -r1.27 date.xml --- functions/date.xml 29 Nov 2005 09:25:12 -0000 1.27 +++ functions/date.xml 31 Jan 2006 20:59:44 -0000 @@ -21,7 +21,7 @@ </para> <tip> <para> - Since PHP 5.1.0 there are a couple of useful <link + Since PHP 5.1.1 there are a couple of useful <link linkend="datetime.constants">constants</link> of standard date/time formats that can be used to specify the <parameter>format</parameter> parameter. @@ -252,6 +252,11 @@ <entry>Example: <literal>+0200</literal></entry> </row> <row> + <entry><literal>P</literal></entry> + <entry>Difference to Greenwich time (GMT) with colon between hours and minutes (added in PHP 5.1.3)</entry> + <entry>Example: <literal>+02:00</literal></entry> + </row> + <row> <entry><literal>T</literal></entry> <entry>Timezone setting of this machine</entry> <entry>Examples: <literal>EST</literal>, <literal>MDT</literal> ...</entry> @@ -314,7 +319,7 @@ // prints something like: Mon, 15 Aug 2005 15:12:46 UTC echo date(DATE_RFC822); -// prints something like: 2000-07-01T00:00:00+0000 +// prints something like: 2000-07-01T00:00:00+00:00 echo date(DATE_ATOM, mktime(0, 0, 0, 7, 1, 2000)); ?> ]]>