mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-25 09:22:07 +01:00
219 lines
5.3 KiB
XML
219 lines
5.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: a4ba07f273fd7d34520a8d02052a746076094e32 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<!-- CREDITS: DAnnebicque -->
|
|
<refentry xml:id="function.localtime" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>localtime</refname>
|
|
<refpurpose>Récupère l'heure locale</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>array</type><methodname>localtime</methodname>
|
|
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>timestamp</parameter><initializer>&null;</initializer></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>associative</parameter><initializer>&false;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>localtime</function> retourne un tableau identique à
|
|
la structure retournée par la fonction C localtime.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
|
|
&date.timestamp.description;
|
|
|
|
<varlistentry>
|
|
<term><parameter>associative</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Détermine si la fonction doit retourner un tableau régulier, indexé
|
|
numériquement, ou un tableau associatif.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Si <parameter>associative</parameter> est définit à &false; ou pas fournit,
|
|
alors le tableau est retourné comme un tableau indexé numériquement standard.
|
|
Si <parameter>associative</parameter> est définit à &true; alors
|
|
<function>localtime</function> retourne un tableau associatif contenant
|
|
les éléments de la structure retourné par l'appel de la
|
|
fonction localtime de C
|
|
Les clés du tableau associatif sont les suivants :
|
|
</para>
|
|
<para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_sec" : secondes, de <literal>0</literal> à <literal>59</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_min" : minutes, de <literal>0</literal> à <literal>59</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_hour" : heure, de <literal>0</literal> à <literal>23</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_mday" : jour du mois, de <literal>1</literal> à <literal>31</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_mon" : mois de l'année, de <literal>0</literal> (Jan) à <literal>11</literal> (Déc)
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_year" : Année depuis 1900
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_wday" : Jour de la semaine, de <literal>0</literal> (Dim) à <literal>6</literal> (Sam)
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_yday" : Jour de l'année, de <literal>0</literal> à <literal>365</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_isdst" : Est-ce que l'heure d'été a pris effet ?
|
|
</simpara>
|
|
<simpara>
|
|
Valeur positive si oui, <literal>0</literal> sinon,
|
|
valeur négative si le résultat n'a pu être déterminé.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<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>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
<parameter>timestamp</parameter> est désormais nullable.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Exemple avec <function>localtime</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$localtime = localtime();
|
|
$localtime_assoc = localtime(time(), true);
|
|
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
|
|
[8] => 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>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>getdate</function></member>
|
|
</simplelist>
|
|
</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:"~/.phpdoc/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
|
|
-->
|