Hi,

I have just edited the function.localtime .xml file (attached) to include an example and also added a note about the value returned in tm_mday and tm_yday. Am I doing this right? If so, will someone with CVS write access will commit it?

Thanks for the help whilst I'm learning this :)

(I haven't tested/checked the XML since I haven't got the tools setup correctly yet)

David
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.10 -->
  <refentry id="function.localtime">
   <refnamediv>
    <refname>localtime</refname>
    <refpurpose>Get the local time</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
     <methodsynopsis>
      <type>array</type><methodname>localtime</methodname>
      <methodparam choice="opt"><type>int</type><parameter>
        timestamp
       </parameter></methodparam>
      <methodparam choice="opt"><type>bool</type><parameter>
        is_associative
       </parameter></methodparam>
     </methodsynopsis>
    <para>
     The <function>localtime</function> function returns an array
     identical to that of the structure returned by the C function
     call.  The first argument to <function>localtime</function> is
     the timestamp, if this is not given the current time as returned
     from <function>time</function> is used.
     The second argument to the <function>localtime</function> is the
     <parameter>is_associative</parameter>, if this is set to 0 or not
     supplied than the array is returned as a regular, numerically
     indexed array.  If the argument is set to 1 then
     <function>localtime</function> is an associative array containing
     all the different elements of the structure returned by the C
     function call to localtime.  The names of the different keys of
     the associative array are as follows:
     <itemizedlist>
      <listitem>
       <simpara>
        "tm_sec" - seconds
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        "tm_min" - minutes
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        "tm_hour" - hour
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        "tm_mday" - day of the month
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        "tm_mon" - month of the year, starting with 0 for January
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        "tm_year" - Years since 1900
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        "tm_wday" - Day of the week
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        "tm_yday" - Day of the year
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        "tm_isdst" - Is daylight savings time in effect
       </simpara>
      </listitem>
     </itemizedlist>
    </para>
	<note>
     <simpara>
      Months are from 0 (Jan) to 11 (Dec) and days of the week are from 0 (Sunday) to 6 (Saturday)
     </simpara>
    </note>
	<para>
     <example>
      <title><function>localtime</function> example</title>
      <programlisting role="php">
<![CDATA[
<?php
$localtime = localtime();
$localtime_assoc = localtime(time(), 1);
print_r($localtime);
print_r($localtime_assoc);
?>
]]>
      </programlisting>
      &example.outputs.similar;
      <screen>
<![CDATA[
Array
(
    [0] => 41
    [1] => 19
    [2] => 1
    [3] => 3
    [4] => 3
    [5] => 105
    [6] => 0
    [7] => 92
    [8] => 1
)
Array
(
    [tm_sec] => 41
    [tm_min] => 19
    [tm_hour] => 1
    [tm_mday] => 3
    [tm_mon] => 3
    [tm_year] => 105
    [tm_wday] => 0
    [tm_yday] => 92
    [tm_isdst] => 1
)
]]>
      </screen>
     </example>
   </refsect1>
  </refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

Reply via email to