mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-04-26 01:58:13 +02:00
9775c99b31
git-svn-id: https://svn.php.net/repository/phpdoc/fr/trunk@189126 c90b9560-bf6c-de11-be94-00142212c4b1
147 lines
3.4 KiB
XML
147 lines
3.4 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.9 $ -->
|
|
<!-- EN-Revision: 1.7 Maintainer: yannick Status: ready -->
|
|
<refentry id="function.localtime">
|
|
<refnamediv>
|
|
<refname>localtime</refname>
|
|
<refpurpose>Lit l'heure locale</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
&reftitle.description;
|
|
<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>
|
|
<function>localtime</function> retourne un tableau identique à
|
|
la structure retournée par la fonction C localtime. Le premier
|
|
argument <parameter>timestamp</parameter> est un timestamp
|
|
UNIX. S'il n'est pas fourni, l'heure courante est utilisée.
|
|
Le second argument <parameter>is_associative</parameter>, s'il
|
|
est mis à &false; ou ignoré, force <function>localtime</function>
|
|
à retourner un tableau à index numérique. S'il est mis à &true;,
|
|
<function>localtime</function> retourne un tableau associatif,
|
|
avec tous les éléments de la structure C, accessible avec les clés
|
|
suivantes :
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_sec" - secondes
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_min" - minutes
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_hour" - heure
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_mday" - jour du mois
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_mon" - mois de l'année, commence par 0 pour Janvier
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_year" - Année, incompatible an 2000
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_wday" - Jour de la semaine
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_yday" - Jour de l'année
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_isdst" - Est-ce que l'heure d'hiver a pris effet?
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
<note>
|
|
<simpara>
|
|
Les mois vont de 0 (Janvier) à 11 (Décembre) et les jours, de 0 (Dimanche) à 6 (Samedi).
|
|
</simpara>
|
|
</note>
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>time</function></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] => 24
|
|
[1] => 3
|
|
[2] => 19
|
|
[3] => 3
|
|
[4] => 3
|
|
[5] => 105
|
|
[6] => 0
|
|
[7] => 92
|
|
[9] => 1
|
|
)
|
|
|
|
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
|
|
)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</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
|
|
--> |