svn: /phpdoc/ doc-base/trunk/entities/global.ent en/trunk/reference/datetime/dateinterval/construct.xml
| From: | Daniel Convissor | Date: | Fri, 28 Aug 2009 16:02:21 +0000 |
| Subject: | svn: /phpdoc/ doc-base/trunk/entities/global.ent en/trunk/reference/datetime/dateinterval/construct.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-4796@lists.php.net to get a copy of this message | ||
danielc Fri, 28 Aug 2009 16:02:21 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=287858
Log:
Adjust recent DateInterval changes based on feedback from Derick. Add link to interval format spec.
Changed paths:
U phpdoc/doc-base/trunk/entities/global.ent
U phpdoc/en/trunk/reference/datetime/dateinterval/construct.xml
Modified: phpdoc/doc-base/trunk/entities/global.ent
===================================================================
--- phpdoc/doc-base/trunk/entities/global.ent 2009-08-28 15:59:28 UTC (rev 287857)
+++ phpdoc/doc-base/trunk/entities/global.ent 2009-08-28 16:02:21 UTC (rev 287858)
@@ -200,6 +200,7 @@
<!ENTITY url.ircg "http://www.schumann.cx/ircg/">
<!ENTITY url.iso-3166-3 "http://www.unicode.org/onlinedat/countries.html">
<!ENTITY url.iso-639 "http://www.w3.org/WAI/ER/IG/ert/iso639.htm">
+<!ENTITY url.iso-8601.duration "http://en.wikipedia.org/wiki/Iso8601#Durations">
<!ENTITY url.jacobi "http://primes.utm.edu/glossary/page.php?sort=JacobiSymbol">
<!ENTITY url.jade "http://www.jclark.com/jade/">
<!ENTITY url.jclark "http://www.jclark.com/bio.htm">
Modified: phpdoc/en/trunk/reference/datetime/dateinterval/construct.xml
===================================================================
--- phpdoc/en/trunk/reference/datetime/dateinterval/construct.xml 2009-08-28 15:59:28 UTC (rev
287857)
+++ phpdoc/en/trunk/reference/datetime/dateinterval/construct.xml 2009-08-28 16:02:21 UTC (rev
287858)
@@ -29,33 +29,67 @@
Interval specification.
</para>
<para>
- The <emphasis>date portion</emphasis>, if any,
- starts with the letter <literal>P</literal>.
- Each date unit is represented by an integer value
- followed by the letter indicating the unit type.
- The date unit types are
- <literal>Y</literal> for years,
- <literal>M</literal> for months and
- <literal>D</literal> for days.
- For example, the format to create a two day
- interval is <literal>P2D</literal>.
+ The format starts with the letter <literal>P</literal>,
+ for <quote>period.</quote>
+ Each duration period is represented by an integer value
+ followed by a period designator.
+ If the duration contains time elements, that portion
+ of the specification is preceded by the letter
+ <literal>T</literal>.
</para>
<para>
- The <emphasis>time portion</emphasis>, if any,
- starts with the letter <literal>T</literal>.
- Each time unit is represented by an integer value
- followed by the letter indicating the unit type.
- The time unit types are
- <literal>H</literal> for hours,
- <literal>M</literal> for minutes and
- <literal>S</literal> for seconds.
- For example, the format to create a two second
- interval is <literal>T2S</literal>.
+ <table>
+ <title>
+ <parameter>interval_spec</parameter> Period Designators
+ </title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Period Designator</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+ <tbody>
+ <row>
+ <entry><literal>Y</literal></entry>
+ <entry>years</entry>
+ </row>
+ <row>
+ <entry><literal>M</literal></entry>
+ <entry>months</entry>
+ </row>
+ <row>
+ <entry><literal>D</literal></entry>
+ <entry>days</entry>
+ </row>
+ <row>
+ <entry><literal>W</literal></entry>
+ <entry>
+ weeks. These get converted into days,
+ so can not be combined with <literal>D</literal>.
+ </entry>
+ </row>
+ <row>
+ <entry><literal>H</literal></entry>
+ <entry>hours</entry>
+ </row>
+ <row>
+ <entry><literal>M</literal></entry>
+ <entry>minutes</entry>
+ </row>
+ <row>
+ <entry><literal>S</literal></entry>
+ <entry>seconds</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
</para>
<para>
- The date and time portions can be combined. To
- demonstrate, an interval of six years and five minutes
- is represented by <literal>P6YT5M</literal>.
+ Here are some simple examples.
+ Two days is <literal>P2D</literal>.
+ Two seconds is <literal>PT2S</literal>.
+ Six years and five minutes is <literal>P6YT5M</literal>.
</para>
<note>
<para>
@@ -69,10 +103,17 @@
</para>
</note>
<para>
- The format can also be entered in an ISO format.
+ The specification can also be represented as a date time.
A sample of one year and four days would be
<literal>P0001-00-04T00:00:00</literal>.
+ But the values in this format can exceed a given period's
+ roll-over-point (e.g. <literal>25</literal> hours is invalid).
</para>
+ <para>
+ This format is based on the <link
+ xlink:href="&url.iso-8601.duration;">ISO 8601 duration
+ specification</link>.
+ </para>
</listitem>
</varlistentry>
</variablelist>