2002-04-15 00:12:54 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2008-08-08 05:58:36 +00:00
|
|
|
<!-- $Revision: 1.13 $ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id="function.localtime" xmlns="http://docbook.org/ns/docbook">
|
2005-04-24 23:50:58 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>localtime</refname>
|
|
|
|
<refpurpose>Get the local time</refpurpose>
|
|
|
|
</refnamediv>
|
2006-07-11 07:05:04 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2005-04-24 23:50:58 +00:00
|
|
|
<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
|
2006-07-11 07:05:04 +00:00
|
|
|
call.
|
2005-04-24 23:50:58 +00:00
|
|
|
</para>
|
2006-07-11 07:05:04 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
|
|
|
|
&date.timestamp.description;
|
|
|
|
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>is_associative</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2008-08-08 05:58:36 +00:00
|
|
|
If set to &false; or not supplied then the array is returned as a regular,
|
2006-07-11 07:05:04 +00:00
|
|
|
numerically indexed array. If the argument is set to &true; then
|
2008-08-08 05:58:36 +00:00
|
|
|
<function>localtime</function> returns an associative array containing
|
2006-07-11 07:05:04 +00:00
|
|
|
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:
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<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>
|
|
|
|
<simpara>
|
|
|
|
Months are from 0 (Jan) to 11 (Dec) and days of the week are from 0 (Sun) to 6 (Sat).
|
|
|
|
</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>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2006-09-08 09:04:09 +00:00
|
|
|
<refsect1 role="errors">
|
|
|
|
&reftitle.errors;
|
|
|
|
|
|
|
|
&date.timezone.errors.description;
|
|
|
|
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="changelog">
|
|
|
|
&reftitle.changelog;
|
|
|
|
<para>
|
|
|
|
<informaltable>
|
|
|
|
<tgroup cols="2">
|
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>&Version;</entry>
|
|
|
|
<entry>&Description;</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
&date.timezone.errors.changelog;
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</informaltable>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2006-07-11 07:05:04 +00:00
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2005-04-24 23:50:58 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
2006-07-12 03:06:19 +00:00
|
|
|
<title><function>localtime</function> example</title>
|
2005-04-24 23:50:58 +00:00
|
|
|
<programlisting role="php">
|
2005-04-03 19:36:42 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$localtime = localtime();
|
2005-06-23 08:02:08 +00:00
|
|
|
$localtime_assoc = localtime(time(), true);
|
2005-04-03 19:36:42 +00:00
|
|
|
print_r($localtime);
|
|
|
|
print_r($localtime_assoc);
|
|
|
|
?>
|
|
|
|
]]>
|
2005-04-24 23:50:58 +00:00
|
|
|
</programlisting>
|
|
|
|
&example.outputs.similar;
|
|
|
|
<screen>
|
2005-04-03 19:36:42 +00:00
|
|
|
<![CDATA[
|
|
|
|
Array
|
|
|
|
(
|
|
|
|
[0] => 24
|
|
|
|
[1] => 3
|
|
|
|
[2] => 19
|
|
|
|
[3] => 3
|
|
|
|
[4] => 3
|
|
|
|
[5] => 105
|
|
|
|
[6] => 0
|
|
|
|
[7] => 92
|
2006-04-12 12:34:50 +00:00
|
|
|
[8] => 1
|
2005-04-03 19:36:42 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
Array
|
|
|
|
(
|
|
|
|
[tm_sec] => 24
|
|
|
|
[tm_min] => 3
|
|
|
|
[tm_hour] => 19
|
|
|
|
[tm_mday] => 3
|
|
|
|
[tm_mon] => 3
|
|
|
|
[tm_year] => 105
|
|
|
|
[tm_wday] => 0
|
|
|
|
[tm_yday] => 92
|
|
|
|
[tm_isdst] => 1
|
|
|
|
)
|
|
|
|
]]>
|
2005-04-24 23:50:58 +00:00
|
|
|
</screen>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
</refentry>
|
2002-04-15 00:12:54 +00:00
|
|
|
|
|
|
|
<!-- 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
|
|
|
|
-->
|