cvs: phpdoc-cs /reference/datetime/functions gettimeofday.xml gmdate.xml gmmktime.xml gmstrftime.xml localtime.xml microtime.xml mktime.xml
| From: | Lukas Jelinek | Date: | Tue, 03 Sep 2002 20:20:51 +0000 |
| Subject: | cvs: phpdoc-cs /reference/datetime/functions gettimeofday.xml gmdate.xml gmmktime.xml gmstrftime.xml localtime.xml microtime.xml mktime.xml | ||
| Groups: | php.doc.cs | ||
| Request: | Send a blank email to doc-cs+get-16@lists.php.net to get a copy of this message | ||
luk Tue Sep 3 16:20:51 2002 EDT
Added files:
/phpdoc-cs/reference/datetime/functions gettimeofday.xml gmdate.xml
gmmktime.xml gmstrftime.xml
localtime.xml microtime.xml
mktime.xml
Log:
Index: phpdoc-cs/reference/datetime/functions/gettimeofday.xml +++ phpdoc-cs/reference/datetime/functions/gettimeofday.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.2 Maintainer: luk Status: ready --> <refentry id="function.gettimeofday"> <refnamediv> <refname>gettimeofday</refname> <refpurpose>Vrací aktuální èas</refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>array</type><methodname>gettimeofday</methodname> <void/> </methodsynopsis> <para> Toto je rozhraní k volání gettimeofday(2). Vrací asociativní pole obsahující data vrácená tímto systémovým voláním. <itemizedlist> <listitem> <simpara> "sec" - sekundy </simpara> </listitem> <listitem> <simpara> "usec" - mikrosekundy </simpara> </listitem> <listitem> <simpara> "minuteswest" - minuty západnì od Greenwiche </simpara> </listitem> <listitem> <simpara> "dsttime" - typ korekce letního èasu </simpara> </listitem> </itemizedlist> </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: --> Index: phpdoc-cs/reference/datetime/functions/gmdate.xml +++ phpdoc-cs/reference/datetime/functions/gmdate.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.2 Maintainer: luk Status: ready --> <refentry id="function.gmdate"> <refnamediv> <refname>gmdate</refname> <refpurpose>Formátuje datum/èas GMT/CUT</refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>string</type><methodname>gmdate</methodname> <methodparam><type>string</type><parameter>format</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>timestamp</parameter></methodparam> </methodsynopsis> <para> Identické k funkci <function>date</function> kromì toho, ¾e vrácený èas je Greenwich Mean Time (GMT). Napøíklad pøi spu¹tìní ve Finsku (GMT +0200) vypí¹e první ní¾e uvedený øádek "Jan 01 1998 00:00:00", zatímco druhý "Dec 31 1997 22:00:00". <example> <title>Pøíklad - <function>gmdate</function></title> <programlisting role="php"> <![CDATA[ echo date ("M d Y H:i:s", mktime (0,0,0,1,1,1998)); echo gmdate ("M d Y H:i:s", mktime (0,0,0,1,1,1998)); ]]> </programlisting> </example> </para> <para> Viz také <function>date</function>, <function>mktime</function>, <function>gmmktime</function> a <function>strftime</function>. </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: --> Index: phpdoc-cs/reference/datetime/functions/gmmktime.xml +++ phpdoc-cs/reference/datetime/functions/gmmktime.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.2 Maintainer: luk Status: ready --> <refentry id="function.gmmktime"> <refnamediv> <refname>gmmktime</refname> <refpurpose>Vrací UNIXové èasové razítko pro datum/èas v GMT</refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>int</type><methodname>gmmktime</methodname> <methodparam><type>int</type><parameter>hour</parameter></methodparam> <methodparam><type>int</type><parameter>minute</parameter></methodparam> <methodparam><type>int</type><parameter>second</parameter></methodparam> <methodparam><type>int</type><parameter>month</parameter></methodparam> <methodparam><type>int</type><parameter>day</parameter></methodparam> <methodparam><type>int</type><parameter>year</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>is_dst</parameter></methodparam> </methodsynopsis> <para> Identické k <function>mktime</function>, kromì toho, ¾e parametry reprezentují datum/èas v GMT. </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: --> Index: phpdoc-cs/reference/datetime/functions/gmstrftime.xml +++ phpdoc-cs/reference/datetime/functions/gmstrftime.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.3 Maintainer: luk Status: ready --> <refentry id="function.gmstrftime"> <refnamediv> <refname>gmstrftime</refname> <refpurpose> Formátuje datum/èas v GMT/CUT vzhledem k národnímu nastavení </refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>string</type><methodname>gmstrftime</methodname> <methodparam><type>string</type><parameter>format</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>timestamp</parameter></methodparam> </methodsynopsis> <para> Chová se stejnì jako <function>strftime</function>, av¹ak vrácený èas je v Greenwich Mean Time (GMT). Napøíklad pøi spu¹tìní v èase EST (východní standardní èas, GMT -0500) vypí¹e první ní¾e uvedený øádek "Dec 31 1998 20:00:00", zatímco druhý "Jan 01 1999 01:00:00". <example> <title><function>gmstrftime</function> example</title> <programlisting role="php"> <![CDATA[ setlocale (LC_TIME, 'en_US'); echo strftime ("%b %d %Y %H:%M:%S", mktime (20,0,0,12,31,98))."\n"; echo gmstrftime ("%b %d %Y %H:%M:%S", mktime (20,0,0,12,31,98))."\n"; ]]> </programlisting> </example> </para> <para> Viz také <function>strftime</function>. </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: --> Index: phpdoc-cs/reference/datetime/functions/localtime.xml +++ phpdoc-cs/reference/datetime/functions/localtime.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.2 Maintainer: luk Status: ready --> <refentry id="function.localtime"> <refnamediv> <refname>localtime</refname> <refpurpose>Vrací místní èas</refpurpose> </refnamediv> <refsect1> <title>Popis</title> <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> Funkce <function>localtime</function> vrací pole strukturálnì identické k návratové hodnotì volání v C. První argument funkce <function>localtime</function> je èasové razítko; není-li dáno, pou¾ije se aktuální èas. Druhý argument <function>localtime</function> je <parameter>is_associative</parameter>, který (nastavením na nulu) signalizuje, ¾e vracené pole je obyèejné, èíselnì indexované pole. Je-li argument nastaven na 1, potom <function>localtime</function> vrací asociativní pole obsahující v¹echny elementy struktury vrácené pøíslu¹ným funkèním voláním v C. Názvy klíèù tohoto pole jsou následující: <itemizedlist> <listitem> <simpara> "tm_sec" - sekunda </simpara> </listitem> <listitem> <simpara> "tm_min" - minuta </simpara> </listitem> <listitem> <simpara> "tm_hour" - hodina </simpara> </listitem> <listitem> <simpara> "tm_mday" - den v mìsíci </simpara> </listitem> <listitem> <simpara> "tm_mon" - mìsíc v roce, poèínaje 0 (leden) </simpara> </listitem> <listitem> <simpara> "tm_year" - roky od 1900 </simpara> </listitem> <listitem> <simpara> "tm_wday" - den v týdnu </simpara> </listitem> <listitem> <simpara> "tm_yday" - den v roce </simpara> </listitem> <listitem> <simpara> "tm_isdst" - platí letní èas </simpara> </listitem> </itemizedlist> </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: --> Index: phpdoc-cs/reference/datetime/functions/microtime.xml +++ phpdoc-cs/reference/datetime/functions/microtime.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.2 Maintainer: luk Status: ready --> <refentry id="function.microtime"> <refnamediv> <refname>microtime</refname> <refpurpose> Vrací aktuální UNIXové èasové razítko s mikrosekundami</refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>string</type><methodname>microtime</methodname> <void/> </methodsynopsis> <para> Vrací øetìzec "msec sec", kde sec je aktuální èas mìøený poètem sekund od Unix Epoch (0:00:00 January 1, 1970 GMT) a msec je mikrosekundová èást. Tato funkce je dostupná pouze na operaèních systémech, které podporují systémové volání gettimeofday(). </para> <para> Obì èásti øetìzce jsou vráceny v jednotkách sekund. <example> <title>Pøíklad - <function>microtime</function></title> <programlisting role="php"> <![CDATA[ function getmicrotime(){ list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } $time_start = getmicrotime(); for ($i=0; $i < 1000; $i++){ // nic nedìlej, 1000krát } $time_end = getmicrotime(); $time = $time_end - $time_start; echo "Nic se nedìlalo $time sekund"; ]]> </programlisting> </example> </para> <para> Viz také <function>time</function>. </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: --> Index: phpdoc-cs/reference/datetime/functions/mktime.xml +++ phpdoc-cs/reference/datetime/functions/mktime.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.2 Maintainer: luk Status: ready --> <refentry id="function.mktime"> <refnamediv> <refname>mktime</refname> <refpurpose>Vrací UNIXové èasové razítko pro datum/èas</refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>int</type><methodname>mktime</methodname> <methodparam><type>int</type><parameter>hour</parameter></methodparam> <methodparam><type>int</type><parameter>minute</parameter></methodparam> <methodparam><type>int</type><parameter>second</parameter></methodparam> <methodparam><type>int</type><parameter>month</parameter></methodparam> <methodparam><type>int</type><parameter>day</parameter></methodparam> <methodparam><type>int</type><parameter>year</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>is_dst</parameter></methodparam> </methodsynopsis> <para> <emphasis>Varování:</emphasis> Mìjte na pamìti podivné poøadí argumentù, které se li¹í od poøadí argumentù v bì¾ném UNIXovém volání mktime() a které se pøíli¹ nehodí k vynechávání parametrù zprava doleva (viz ní¾e). Je èastou chybou míchat ve skriptu tyto hodnoty. </para> <para> Vrací UNIXové èasové razítko odpovídající daným argumentùm. Toto èasové razítko je typu "long integer" a odpovídá poètu sekund mezi Unix Epoch (1.1.1970) a specifikovaným èasem. </para> <para> Argumenty mohou být vynechávány zprava doleva; ka¾dý vynechaný argument bude nastaven na aktuální hodnotu podle místního data a èasu. </para> <para> <parameter>is_dst</parameter> mù¾e být 1, patøí-li daný èas do doby platnosti letního èasu, 0, pokud nepatøí, anebo -1 (implicitní hodnota), nelze-li zjistit, zda daný èas patøí do období letního èasu (v tomto pøípadì se PHP pokusí tuto hodnotu dosadit; to mù¾e zpùsobit neoèekávané - ale nikoli chybné - výsledky). </para> <note> <para> Parametr <parameter>is_dst</parameter> byl pøidán v PHP 3.0.10. </para> </note> <para> Funkce <function>mktime</function> je u¾iteèná pro aritmetiku a validaci èasových údajù, nebo» automaticky vypoèítá správnou hodnotu pro vstupní data mimo povolený rozsah. Napøíklad ka¾dý z následujících øádkù vypí¹e "Jan-01-1998". <example> <title>Pøíklad - <function>mktime</function></title> <programlisting role="php"> <![CDATA[ echo date ("M-d-Y", mktime (0,0,0,12,32,1997)); echo date ("M-d-Y", mktime (0,0,0,13,1,1997)); echo date ("M-d-Y", mktime (0,0,0,1,1,1998)); echo date ("M-d-Y", mktime (0,0,0,1,1,98)); ]]> </programlisting> </example> <parameter>Year</parameter> mù¾e být hodnota se dvìma nebo ètyømi èíslicemi, s hodnotami 0-69 mapovanými na 2000-2069 a 70-99 na 1970-1999 (na systémech, kde time_t je 32bitové celé èíslo se znaménkem, jak je dnes obvyklé, budou platné hodnoty pro <parameter>year</parameter> nìkde mezi 1902 a 2037). </para> <para> Poslední den daného mìsíce mù¾e být vyjádøen jako den "0" mìsíce pøí¹tího, nikoliv den -1. Oba následující pøíklady vypí¹í øetìzec "The last day in Feb 2000 is: 29". <example> <title>Poslední den mìsíce</title> <programlisting role="php"> <![CDATA[ $lastday = mktime (0,0,0,3,0,2000); echo strftime ("Last day in Feb 2000 is: %d", $lastday); $lastday = mktime (0,0,0,4,-31,2000); echo strftime ("Last day in Feb 2000 is: %d", $lastday); ]]> </programlisting> </example> </para> <simpara> Datum s rokem, mìsícem, a dnem rovnými nule je pova¾ováno za neplatné (odpovídalo by 30.11.1999, co¾ je ponìkud podivné chování). </simpara> <para> Viz také <function>date</function> a <function>time</function>. </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: -->
Index: phpdoc-cs/reference/datetime/functions/gettimeofday.xml +++ phpdoc-cs/reference/datetime/functions/gettimeofday.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.2 Maintainer: luk Status: ready --> <refentry id="function.gettimeofday"> <refnamediv> <refname>gettimeofday</refname> <refpurpose>Vrací aktuální èas</refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>array</type><methodname>gettimeofday</methodname> <void/> </methodsynopsis> <para> Toto je rozhraní k volání gettimeofday(2). Vrací asociativní pole obsahující data vrácená tímto systémovým voláním. <itemizedlist> <listitem> <simpara> "sec" - sekundy </simpara> </listitem> <listitem> <simpara> "usec" - mikrosekundy </simpara> </listitem> <listitem> <simpara> "minuteswest" - minuty západnì od Greenwiche </simpara> </listitem> <listitem> <simpara> "dsttime" - typ korekce letního èasu </simpara> </listitem> </itemizedlist> </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: --> Index: phpdoc-cs/reference/datetime/functions/gmdate.xml +++ phpdoc-cs/reference/datetime/functions/gmdate.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.2 Maintainer: luk Status: ready --> <refentry id="function.gmdate"> <refnamediv> <refname>gmdate</refname> <refpurpose>Formátuje datum/èas GMT/CUT</refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>string</type><methodname>gmdate</methodname> <methodparam><type>string</type><parameter>format</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>timestamp</parameter></methodparam> </methodsynopsis> <para> Identické k funkci <function>date</function> kromì toho, ¾e vrácený èas je Greenwich Mean Time (GMT). Napøíklad pøi spu¹tìní ve Finsku (GMT +0200) vypí¹e první ní¾e uvedený øádek "Jan 01 1998 00:00:00", zatímco druhý "Dec 31 1997 22:00:00". <example> <title>Pøíklad - <function>gmdate</function></title> <programlisting role="php"> <![CDATA[ echo date ("M d Y H:i:s", mktime (0,0,0,1,1,1998)); echo gmdate ("M d Y H:i:s", mktime (0,0,0,1,1,1998)); ]]> </programlisting> </example> </para> <para> Viz také <function>date</function>, <function>mktime</function>, <function>gmmktime</function> a <function>strftime</function>. </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: --> Index: phpdoc-cs/reference/datetime/functions/gmmktime.xml +++ phpdoc-cs/reference/datetime/functions/gmmktime.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.2 Maintainer: luk Status: ready --> <refentry id="function.gmmktime"> <refnamediv> <refname>gmmktime</refname> <refpurpose>Vrací UNIXové èasové razítko pro datum/èas v GMT</refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>int</type><methodname>gmmktime</methodname> <methodparam><type>int</type><parameter>hour</parameter></methodparam> <methodparam><type>int</type><parameter>minute</parameter></methodparam> <methodparam><type>int</type><parameter>second</parameter></methodparam> <methodparam><type>int</type><parameter>month</parameter></methodparam> <methodparam><type>int</type><parameter>day</parameter></methodparam> <methodparam><type>int</type><parameter>year</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>is_dst</parameter></methodparam> </methodsynopsis> <para> Identické k <function>mktime</function>, kromì toho, ¾e parametry reprezentují datum/èas v GMT. </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: --> Index: phpdoc-cs/reference/datetime/functions/gmstrftime.xml +++ phpdoc-cs/reference/datetime/functions/gmstrftime.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.3 Maintainer: luk Status: ready --> <refentry id="function.gmstrftime"> <refnamediv> <refname>gmstrftime</refname> <refpurpose> Formátuje datum/èas v GMT/CUT vzhledem k národnímu nastavení </refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>string</type><methodname>gmstrftime</methodname> <methodparam><type>string</type><parameter>format</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>timestamp</parameter></methodparam> </methodsynopsis> <para> Chová se stejnì jako <function>strftime</function>, av¹ak vrácený èas je v Greenwich Mean Time (GMT). Napøíklad pøi spu¹tìní v èase EST (východní standardní èas, GMT -0500) vypí¹e první ní¾e uvedený øádek "Dec 31 1998 20:00:00", zatímco druhý "Jan 01 1999 01:00:00". <example> <title><function>gmstrftime</function> example</title> <programlisting role="php"> <![CDATA[ setlocale (LC_TIME, 'en_US'); echo strftime ("%b %d %Y %H:%M:%S", mktime (20,0,0,12,31,98))."\n"; echo gmstrftime ("%b %d %Y %H:%M:%S", mktime (20,0,0,12,31,98))."\n"; ]]> </programlisting> </example> </para> <para> Viz také <function>strftime</function>. </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: --> Index: phpdoc-cs/reference/datetime/functions/localtime.xml +++ phpdoc-cs/reference/datetime/functions/localtime.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.2 Maintainer: luk Status: ready --> <refentry id="function.localtime"> <refnamediv> <refname>localtime</refname> <refpurpose>Vrací místní èas</refpurpose> </refnamediv> <refsect1> <title>Popis</title> <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> Funkce <function>localtime</function> vrací pole strukturálnì identické k návratové hodnotì volání v C. První argument funkce <function>localtime</function> je èasové razítko; není-li dáno, pou¾ije se aktuální èas. Druhý argument <function>localtime</function> je <parameter>is_associative</parameter>, který (nastavením na nulu) signalizuje, ¾e vracené pole je obyèejné, èíselnì indexované pole. Je-li argument nastaven na 1, potom <function>localtime</function> vrací asociativní pole obsahující v¹echny elementy struktury vrácené pøíslu¹ným funkèním voláním v C. Názvy klíèù tohoto pole jsou následující: <itemizedlist> <listitem> <simpara> "tm_sec" - sekunda </simpara> </listitem> <listitem> <simpara> "tm_min" - minuta </simpara> </listitem> <listitem> <simpara> "tm_hour" - hodina </simpara> </listitem> <listitem> <simpara> "tm_mday" - den v mìsíci </simpara> </listitem> <listitem> <simpara> "tm_mon" - mìsíc v roce, poèínaje 0 (leden) </simpara> </listitem> <listitem> <simpara> "tm_year" - roky od 1900 </simpara> </listitem> <listitem> <simpara> "tm_wday" - den v týdnu </simpara> </listitem> <listitem> <simpara> "tm_yday" - den v roce </simpara> </listitem> <listitem> <simpara> "tm_isdst" - platí letní èas </simpara> </listitem> </itemizedlist> </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: --> Index: phpdoc-cs/reference/datetime/functions/microtime.xml +++ phpdoc-cs/reference/datetime/functions/microtime.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.2 Maintainer: luk Status: ready --> <refentry id="function.microtime"> <refnamediv> <refname>microtime</refname> <refpurpose> Vrací aktuální UNIXové èasové razítko s mikrosekundami</refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>string</type><methodname>microtime</methodname> <void/> </methodsynopsis> <para> Vrací øetìzec "msec sec", kde sec je aktuální èas mìøený poètem sekund od Unix Epoch (0:00:00 January 1, 1970 GMT) a msec je mikrosekundová èást. Tato funkce je dostupná pouze na operaèních systémech, které podporují systémové volání gettimeofday(). </para> <para> Obì èásti øetìzce jsou vráceny v jednotkách sekund. <example> <title>Pøíklad - <function>microtime</function></title> <programlisting role="php"> <![CDATA[ function getmicrotime(){ list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); } $time_start = getmicrotime(); for ($i=0; $i < 1000; $i++){ // nic nedìlej, 1000krát } $time_end = getmicrotime(); $time = $time_end - $time_start; echo "Nic se nedìlalo $time sekund"; ]]> </programlisting> </example> </para> <para> Viz také <function>time</function>. </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: --> Index: phpdoc-cs/reference/datetime/functions/mktime.xml +++ phpdoc-cs/reference/datetime/functions/mktime.xml <?xml version="1.0" encoding="iso-8859-2"?> <!-- EN-Revision: 1.2 Maintainer: luk Status: ready --> <refentry id="function.mktime"> <refnamediv> <refname>mktime</refname> <refpurpose>Vrací UNIXové èasové razítko pro datum/èas</refpurpose> </refnamediv> <refsect1> <title>Popis</title> <methodsynopsis> <type>int</type><methodname>mktime</methodname> <methodparam><type>int</type><parameter>hour</parameter></methodparam> <methodparam><type>int</type><parameter>minute</parameter></methodparam> <methodparam><type>int</type><parameter>second</parameter></methodparam> <methodparam><type>int</type><parameter>month</parameter></methodparam> <methodparam><type>int</type><parameter>day</parameter></methodparam> <methodparam><type>int</type><parameter>year</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>is_dst</parameter></methodparam> </methodsynopsis> <para> <emphasis>Varování:</emphasis> Mìjte na pamìti podivné poøadí argumentù, které se li¹í od poøadí argumentù v bì¾ném UNIXovém volání mktime() a které se pøíli¹ nehodí k vynechávání parametrù zprava doleva (viz ní¾e). Je èastou chybou míchat ve skriptu tyto hodnoty. </para> <para> Vrací UNIXové èasové razítko odpovídající daným argumentùm. Toto èasové razítko je typu "long integer" a odpovídá poètu sekund mezi Unix Epoch (1.1.1970) a specifikovaným èasem. </para> <para> Argumenty mohou být vynechávány zprava doleva; ka¾dý vynechaný argument bude nastaven na aktuální hodnotu podle místního data a èasu. </para> <para> <parameter>is_dst</parameter> mù¾e být 1, patøí-li daný èas do doby platnosti letního èasu, 0, pokud nepatøí, anebo -1 (implicitní hodnota), nelze-li zjistit, zda daný èas patøí do období letního èasu (v tomto pøípadì se PHP pokusí tuto hodnotu dosadit; to mù¾e zpùsobit neoèekávané - ale nikoli chybné - výsledky). </para> <note> <para> Parametr <parameter>is_dst</parameter> byl pøidán v PHP 3.0.10. </para> </note> <para> Funkce <function>mktime</function> je u¾iteèná pro aritmetiku a validaci èasových údajù, nebo» automaticky vypoèítá správnou hodnotu pro vstupní data mimo povolený rozsah. Napøíklad ka¾dý z následujících øádkù vypí¹e "Jan-01-1998". <example> <title>Pøíklad - <function>mktime</function></title> <programlisting role="php"> <![CDATA[ echo date ("M-d-Y", mktime (0,0,0,12,32,1997)); echo date ("M-d-Y", mktime (0,0,0,13,1,1997)); echo date ("M-d-Y", mktime (0,0,0,1,1,1998)); echo date ("M-d-Y", mktime (0,0,0,1,1,98)); ]]> </programlisting> </example> <parameter>Year</parameter> mù¾e být hodnota se dvìma nebo ètyømi èíslicemi, s hodnotami 0-69 mapovanými na 2000-2069 a 70-99 na 1970-1999 (na systémech, kde time_t je 32bitové celé èíslo se znaménkem, jak je dnes obvyklé, budou platné hodnoty pro <parameter>year</parameter> nìkde mezi 1902 a 2037). </para> <para> Poslední den daného mìsíce mù¾e být vyjádøen jako den "0" mìsíce pøí¹tího, nikoliv den -1. Oba následující pøíklady vypí¹í øetìzec "The last day in Feb 2000 is: 29". <example> <title>Poslední den mìsíce</title> <programlisting role="php"> <![CDATA[ $lastday = mktime (0,0,0,3,0,2000); echo strftime ("Last day in Feb 2000 is: %d", $lastday); $lastday = mktime (0,0,0,4,-31,2000); echo strftime ("Last day in Feb 2000 is: %d", $lastday); ]]> </programlisting> </example> </para> <simpara> Datum s rokem, mìsícem, a dnem rovnými nule je pova¾ováno za neplatné (odpovídalo by 30.11.1999, co¾ je ponìkud podivné chování). </simpara> <para> Viz také <function>date</function> a <function>time</function>. </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: -->