jimw Fri Dec 14 15:59:38 2001 EDT
Modified files:
/phpdoc/en/functions datetime.xml
Log:
strtotime: add last/next examples, document now parameter, add note about timestamp
range
Index: phpdoc/en/functions/datetime.xml
diff -u phpdoc/en/functions/datetime.xml:1.57 phpdoc/en/functions/datetime.xml:1.58
--- phpdoc/en/functions/datetime.xml:1.57 Wed Dec 12 19:44:47 2001
+++ phpdoc/en/functions/datetime.xml Fri Dec 14 15:59:38 2001
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.57 $ -->
+<!-- $Revision: 1.58 $ -->
<reference id="ref.datetime">
<title>Date and Time functions</title>
<titleabbrev>Date/time</titleabbrev>
@@ -1112,12 +1112,13 @@
</funcprototype>
</funcsynopsis>
<simpara>
- The function expects to be given a string containing an English
- date format and will try to parse that format into a UNIX
- timestamp. Upon failure, <literal>-1</literal> is returned.
+ The function expects to be given a string containing an English date
+ format and will try to parse that format into a UNIX timestamp relative
+ to the timestamp given in <parameter>now</parameter>, or the current time
+ if none is supplied. Upon failure, <literal>-1</literal> is returned.
</simpara>
<simpara>
- Since <function>strtotime</function> behaves according to GNU
+ Because <function>strtotime</function> behaves according to GNU
date syntax, have a look at the GNU manual page titled
<ulink url="&url.gnu.man.date-input;">Date Input Formats</ulink>.
Described there is valid syntax for the <parameter>time</parameter>
@@ -1128,11 +1129,13 @@
<title><function>strtotime</function> examples</title>
<programlisting role="php">
<![CDATA[
-echo strtotime ("now") . "\n";
-echo strtotime ("10 September 2000") . "\n";
-echo strtotime ("+1 day") . "\n";
-echo strtotime ("+1 week") . "\n";
-echo strtotime ("+1 week 2 days 4 hours 2 seconds") . "\n";
+echo strtotime ("now"), "\n";
+echo strtotime ("10 September 2000"), "\n";
+echo strtotime ("+1 day"), "\n";
+echo strtotime ("+1 week"), "\n";
+echo strtotime ("+1 week 2 days 4 hours 2 seconds"), "\n";
+echo strtotime ("next Thursday"), "\n";
+echo strtotime ("last Monday"), "\n";
]]>
</programlisting>
</example>
@@ -1152,6 +1155,14 @@
</programlisting>
</example>
</para>
+ <note>
+ <para>
+ The valid range of a timestamp is typically from Fri, 13 Dec
+ 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are
+ the dates that correspond to the minimum and maximum values for
+ a 32-bit signed integer.)
+ </para>
+ </note>
</refsect1>
</refentry>