mirror of
https://github.com/php/doc-de.git
synced 2026-03-24 07:12:15 +01:00
219 lines
5.3 KiB
XML
219 lines
5.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 3a8c3e77df070a046c9d5b56b68926ca2d7e5ee3 Maintainer: sammywg Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<!-- Rev-Revision: a4ba07f273fd7d34520a8d02052a746076094e32 Reviewer: samesch -->
|
|
<refentry xml:id="function.localtime" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>localtime</refname>
|
|
<refpurpose>Ermittelt die lokale Zeit</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>
|
|
Die Funktion <function>localtime</function> gibt ein Array zurück, welches
|
|
hinsichtlich seiner Struktur identisch ist mit der des Funktionsaufrufs in C.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
|
|
&date.timestamp.description;
|
|
|
|
<varlistentry>
|
|
<term><parameter>associative</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Bestimmt, ob die Funktion ein gewöhnliches numerisch indiziertes Array
|
|
zurückgeben soll, oder ein assoziatives.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Ist <parameter>associative</parameter> nicht angegeben oder &false;, ist
|
|
das zurückgegebene Array ein gewöhnliches numerisch indiziertes Array. Hat
|
|
<parameter>associative</parameter> den Wert &true;, gibt
|
|
<function>localtime</function> ein assoziatives Array zurück, das die
|
|
Strukturelemente enthält, die beim Aufruf der C-Funktion an localtime
|
|
zurückgegeben werden. Die Namen der Schlüssel des assoziativen Arrays
|
|
lauten:
|
|
</para>
|
|
<para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_sec" - Sekunden, <literal>0</literal> bis <literal>59</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_min" - Minuten, <literal>0</literal> bis <literal>59</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_hour" - Stunden, <literal>0</literal> bis <literal>23</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_mday" - Tag des Monats, <literal>1</literal> bis <literal>31</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_mon" - Monat des Jahres, <literal>0</literal> (Jan) bis <literal>11</literal> (Dez)
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_year" - Jahre seit 1900
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_wday" - Tag der Woche, <literal>0</literal> (Son) bis <literal>6</literal> (Sam)
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_yday" - Tag des Jahres, <literal>0</literal> bis <literal>365</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_isdst" - ist für das Datum die Sommerzeit zu berücksichtigen?
|
|
</simpara>
|
|
<simpara>
|
|
Positiv wenn ja, <literal>0</literal> wenn nein, negativ wenn unbekannt.
|
|
</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> ist nun nullable (akzeptiert den
|
|
&null;-Wert).
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title><function>localtime</function>-Beispiel</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
|
|
-->
|