mirror of
https://github.com/php/doc-pl.git
synced 2026-04-23 14:58:02 +02:00
218 lines
5.2 KiB
XML
Executable File
218 lines
5.2 KiB
XML
Executable File
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 3a8c3e77df070a046c9d5b56b68926ca2d7e5ee3 Maintainer: sobak Status: ready -->
|
|
<!-- $Revision$ -->
|
|
<!-- CREDITS: qrak -->
|
|
<refentry xml:id="function.localtime" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>localtime</refname>
|
|
<refpurpose>Pobiera czas lokalny</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>
|
|
Funkcja <function>localtime</function> zwraca tablicę
|
|
identyczną, do tej zwracanej przez wywołanie identycznej
|
|
funkcji w C.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
|
|
&date.timestamp.description;
|
|
|
|
<varlistentry>
|
|
<term><parameter>associative</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Decyduje czy funkcja powinna zwrócić normalną tablicę indeksowaną numerycznie,
|
|
czy tablicę asocjacyjną.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Jeżeli parametr <parameter>associative</parameter> ustawiono &false; lub nie podano,
|
|
to tablica jest zwracana jako, zwykła tablica indeksowana numerycznie.
|
|
Jeżeli parametr <parameter>associative</parameter> ustawiono na &true;, to
|
|
<function>localtime</function> zwraca tablicę wielowymiarową zawierającą
|
|
rozmaite elementy struktury zwracanej przez wywołanie funkcji localtime w C
|
|
Nazwy różnych kluczy z tej tablicy są następujące:
|
|
</para>
|
|
<para>
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_sec" - sekundy <literal>0</literal> do <literal>59</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_min" - minuty, <literal>0</literal> do <literal>59</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_hour" - godziny, <literal>0</literal> do <literal>23</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_mday" - dzień miesiąca, <literal>1</literal> do <literal>31</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_mon" - miesiąc roku, <literal>0</literal> (styczeń) do <literal>11</literal> (grudzień)
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_year" - ilość lat od 1900
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_wday" - dzień tygodnia, <literal>0</literal> (niedziela) do <literal>6</literal> (sobota)
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_yday" - dzień roku, <literal>0</literal> do <literal>365</literal>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
"tm_isdst" - czy trwa czas letni?
|
|
</simpara>
|
|
<simpara>
|
|
Liczba dodatnia, jeżeli tak, <literal>0</literal> jeżeli nie, ujemna jeżeli nie wiadomo.
|
|
</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>
|
|
Parametr <parameter>timestamp</parameter> dopuszcza teraz &null;.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Przykład użycia <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
|
|
-->
|