nlopess         Sun Oct  3 11:53:48 2004 EDT

  Modified files:              
    /phpdoc/en/reference/datetime/functions     strftime.xml strptime.xml 
  Log:
  document strptime()
  
http://cvs.php.net/diff.php/phpdoc/en/reference/datetime/functions/strftime.xml?r1=1.14&r2=1.15&ty=u
Index: phpdoc/en/reference/datetime/functions/strftime.xml
diff -u phpdoc/en/reference/datetime/functions/strftime.xml:1.14 
phpdoc/en/reference/datetime/functions/strftime.xml:1.15
--- phpdoc/en/reference/datetime/functions/strftime.xml:1.14    Thu Sep  9 04:34:05 
2004
+++ phpdoc/en/reference/datetime/functions/strftime.xml Sun Oct  3 11:53:48 2004
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.14 $ -->
+<!-- $Revision: 1.15 $ -->
 <!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
   <refentry id="function.strftime">
    <refnamediv>
@@ -329,9 +329,10 @@
     </para>
     <para>
      See also <function>setlocale</function>,
-     <function>mktime</function>, and the <ulink url="&spec.strftime;">
-     Open Group specification of
-     <function>strftime</function></ulink>.
+     <function>mktime</function>,
+     <function>strptime</function>,
+     and the <ulink url="&spec.strftime;">
+     Open Group specification of <function>strftime</function></ulink>.
     </para>
    </refsect1>
   </refentry>
http://cvs.php.net/diff.php/phpdoc/en/reference/datetime/functions/strptime.xml?r1=1.1&r2=1.2&ty=u
Index: phpdoc/en/reference/datetime/functions/strptime.xml
diff -u phpdoc/en/reference/datetime/functions/strptime.xml:1.1 
phpdoc/en/reference/datetime/functions/strptime.xml:1.2
--- phpdoc/en/reference/datetime/functions/strptime.xml:1.1     Wed Sep 29 11:39:54 
2004
+++ phpdoc/en/reference/datetime/functions/strptime.xml Sun Oct  3 11:53:48 2004
@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='iso-8859-1'?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
   <refentry id="function.strptime">
    <refnamediv>
     <refname>strptime</refname>
@@ -14,9 +14,148 @@
      <methodparam><type>string</type><parameter>timestamp</parameter></methodparam>
      <methodparam><type>string</type><parameter>format</parameter></methodparam>
     </methodsynopsis>
+    <para>
+     <function>strptime</function> returns an array with the
+     <parameter>timestamp</parameter> parsed, or &false; on error.
+    </para>
+    <para>
+     Month and weekday names and other language dependent strings respect the
+     current locale set with <function>setlocale</function> (LC_TIME).
+    </para>   
+   </refsect1>
 
-    &warn.undocumented.func;
+   <refsect1 role="parameters">
+   &reftitle.parameters;
+   <para>
+    <variablelist>
+     <varlistentry>
+      <term><parameter>timestamp</parameter> (<type>string</type>)</term>
+      <listitem>
+       <para>
+        A timestamp (e.g. returned from <function>strftime</function>)
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><parameter>format</parameter> (<type>string</type>)</term>
+      <listitem>
+       <para>
+        The format used in <parameter>timestamp</parameter> (e.g. the same as
+        used in <function>strftime</function>).
+       </para>
+       <para>
+        For more information about the format options, read the
+        <function>strftime</function> page.
+       </para>
+      </listitem>
+     </varlistentry>
+    </variablelist>
+   </para>
+  </refsect1>
 
+  <refsect1 role="returnvalues">
+   &reftitle.returnvalues;
+   <para>
+    Returns an array, or &false; on failure.
+   </para>
+
+    <para>
+     <table>
+      <title>The following parameters are returned in the array</title>
+      <tgroup cols="2">
+       <thead>
+        <row>
+         <entry>parameters</entry>
+         <entry>Description</entry>
+        </row>
+       </thead>
+       <tbody>
+        <row>
+         <entry>tm_sec</entry>
+         <entry>Seconds after the minute (0-61)</entry>
+        </row>
+        <row>
+         <entry>tm_min</entry>
+         <entry>Minutes after the hour (0-59)</entry>
+        </row>
+        <row>
+         <entry>tm_hour</entry>
+         <entry>Hour since midnight (0-23)</entry>
+        </row>
+        <row>
+         <entry>tm_mday</entry>
+         <entry>Day of the month (1-31)</entry>
+        </row>
+        <row>
+         <entry>tm_mon</entry>
+         <entry>Months since January (0-11)</entry>
+        </row>
+        <row>
+         <entry>tm_year</entry>
+         <entry>Years since 1900</entry>
+        </row>
+        <row>
+         <entry>tm_wday</entry>
+         <entry>Days since Sunday (0-6)</entry>
+        </row>
+        <row>
+         <entry>tm_yday</entry>
+         <entry>Days since January 1 (0-365)</entry>
+        </row>
+       </tbody>
+      </tgroup>
+     </table>
+    </para>
+   
+  </refsect1>
+
+  <refsect1 role="examples">
+   &reftitle.examples;
+   <para>
+   <example>
+    <title><function>strptime</function> example</title>
+    <programlisting role="php">
+<![CDATA[
+<?php
+$format = '%d/%m/%Y %H:%M:%S';
+$strf = strftime($format);
+
+echo "$strf\n";
+
+print_r(strptime($strf, $format));
+?>
+]]>
+      </programlisting>
+      &example.outputs.similar;
+      <screen>
+<![CDATA[
+03/10/2004 15:54:19
+
+Array
+(
+    [tm_sec] => 19
+    [tm_min] => 54
+    [tm_hour] => 15
+    [tm_mday] => 3
+    [tm_mon] => 9
+    [tm_year] => 104
+    [tm_wday] => 0
+    [tm_yday] => 276
+    [unparsed] =>
+)
+]]>
+      </screen>
+      </example>
+     </para>
+    </refsect1>
+
+    <refsect1 role="seealso">
+    &reftitle.seealso;
+    <para>
+     <simplelist>
+      <member><function>strftime</function></member>
+     </simplelist>
+    </para>
     &note.no-windows;
    </refsect1>
   </refentry>

Reply via email to