cvs: phpdoc-zh /reference/datetime/functions getdate.xml gmdate.xml gmmktime.xml gmstrftime.xml localtime.xml microtime.xml mktime.xml strftime.xml
strtotime.xml

From: Date: Sun, 20 Apr 2003 06:22:54 +0000
Subject: cvs: phpdoc-zh /reference/datetime/functions getdate.xml gmdate.xml gmmktime.xml gmstrftime.xml localtime.xml microtime.xml mktime.xml strftime.xml
strtotime.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-1350@lists.php.net to get a copy of this message
dallas Sun Apr 20 02:22:54 2003 EDT Modified files: /phpdoc-zh/reference/datetime/functions getdate.xml gmdate.xml gmmktime.xml gmstrftime.xml localtime.xml microtime.xml mktime.xml strftime.xml strtotime.xml Log: Updated.

Index: phpdoc-zh/reference/datetime/functions/getdate.xml diff -u phpdoc-zh/reference/datetime/functions/getdate.xml:1.2 phpdoc-zh/reference/datetime/functions/getdate.xml:1.3 --- phpdoc-zh/reference/datetime/functions/getdate.xml:1.2 Sun Sep 29 23:07:33 2002 +++ phpdoc-zh/reference/datetime/functions/getdate.xml Sun Apr 20 02:22:53 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.getdate"> <refnamediv> <refname>getdate</refname> @@ -16,69 +16,87 @@ <para> ·µ»ØÒ»¸ö¸ù¾Ý <parameter>timestamp</parameter> µÃ³öµÄ°üº¬ÓÐÈÕÆÚÐÅÏ¢µÄ½áºÏÊý×é¡£Èç¹ûûÓиø³öʱ¼ä´ÁÔòÈÏΪÊǵ±Ç°±¾µØÊ±¼ä¡£Êý×éÖеĵ¥ÔªÈçÏ£º - <itemizedlist> - <listitem> - <simpara> - "seconds" - ÃëÊý - </simpara> - </listitem> - <listitem> - <simpara> - "minutes" - ·ÖÖÓÊý - </simpara> - </listitem> - <listitem> - <simpara> - "hours" - СʱÊý - </simpara> - </listitem> - <listitem> - <simpara> - "mday" - Ô·ÝÖеĵڼ¸ÈÕ - </simpara> - </listitem> - <listitem> - <simpara> - "wday" - ÐÇÆÚÖеĵڼ¸ÈÕ£¬Êý×Ö¸ñʽ£¬´Ó 0 ±íʾÐÇÆÚÌìµ½ 6 ±íʾÐÇÆÚÁù - </simpara> - </listitem> - <listitem> - <simpara> - "mon" - Ô·ݣ¬Êý×Ö - </simpara> - </listitem> - <listitem> - <simpara> - "year" - Äê·Ý£¬Êý×Ö - </simpara> - </listitem> - <listitem> - <simpara> - "yday" - Äê·ÝÖеĵڼ¸ÈÕ£¬Êý×Ö£¬ÀýÈç "299" - </simpara> - </listitem> - <listitem> - <simpara> - "weekday" - ÐÇÆÚÖеĵڼ¸ÈÕ£¬ÍêÕûµÄÎı¾¸ñʽ£¬ÀýÈç "Friday" - </simpara> - </listitem> - <listitem> - <simpara> - "month" - Ô·ݣ¬ÍêÕûµÄÎı¾¸ñʽ£¬ÀýÈç "January" - </simpara> - </listitem> - </itemizedlist> + </para> + <para> + <table> + <title>ÒÔÏÂ×Ö·û¿É±» <parameter>format</parameter> ²ÎÊý×Ö·û´®Ê¶±ð</title> + <tgroup cols="3"> + <thead> + <row> + <entry>¼üÃû</entry> + <entry>˵Ã÷</entry> + <entry>·µ»ØÖµÀý×Ó</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>"seconds"</literal></entry> + <entry>ÃëµÄÊý×Ö±íʾ</entry> + <entry><literal>0</literal> µ½ <literal>59</literal></entry> + </row> + <row> + <entry><literal>"minutes"</literal></entry> + <entry>·ÖÖÓµÄÊý×Ö±íʾ</entry> + <entry><literal>0</literal> µ½ <literal>59</literal></entry> + </row> + <row> + <entry><literal>"hours"</literal></entry> + <entry>СʱµÄÊý×Ö±íʾ</entry> + <entry><literal>0</literal> µ½ <literal>23</literal></entry> + </row> + <row> + <entry><literal>"mday"</literal></entry> + <entry>Ô·ÝÖеڼ¸ÌìµÄÊý×Ö±íʾ</entry> + <entry><literal>1</literal> µ½ <literal>31</literal></entry> + </row> + <row> + <entry><literal>"wday"</literal></entry> + <entry>ÐÇÆÚÖеڼ¸ÌìµÄÊý×Ö±íʾ</entry> + <entry><literal>0</literal>£¨±íʾÐÇÆÚÌ죩µ½ <literal>6</literal>£¨±íʾÐÇÆÚÁù£©</entry> + </row> + <row> + <entry><literal>"mon"</literal></entry> + <entry>Ô·ݵÄÊý×Ö±íʾ</entry> + <entry><literal>1</literal> µ½ <literal>12</literal></entry> + </row> + <row> + <entry><literal>"year"</literal></entry> + <entry>4 λÊý×Ö±íʾµÄÍêÕûÄê·Ý</entry> + <entry>ÀýÈ磺<literal>1999</literal> »ò <literal>2003</literal></entry> + </row> + <row> + <entry><literal>"yday"</literal></entry> + <entry>Ò»ÄêÖеڼ¸ÌìµÄÊý×Ö±íʾ</entry> + <entry><literal>0</literal> µ½ <literal>366</literal></entry> + </row> + <row> + <entry><literal>"weekday"</literal></entry> + <entry>ÐÇÆÚ¼¸µÄÍêÕûÎı¾±íʾ</entry> + <entry><literal>Sunday</literal> µ½ <literal>Saturday</literal></entry> + </row> + <row> + <entry><literal>"month"</literal></entry> + <entry>Ô·ݵÄÍêÕûÎı¾±íʾ</entry> + <entry><literal>January></literal> µ½ <literal>December</literal></entry> + </row> + </tbody> + </tgroup> + </table> + </para> + <para> <example> <title> <function>getdate</function> Àý×Ó </title> <programlisting role="php"> <![CDATA[ +<?php $today = getdate(); $month = $today['month']; $mday = $today['mday']; $year = $today['year']; echo "$month $mday, $year"; +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/datetime/functions/gmdate.xml diff -u phpdoc-zh/reference/datetime/functions/gmdate.xml:1.4 phpdoc-zh/reference/datetime/functions/gmdate.xml:1.5 --- phpdoc-zh/reference/datetime/functions/gmdate.xml:1.4 Wed Mar 12 05:01:35 2003 +++ phpdoc-zh/reference/datetime/functions/gmdate.xml Sun Apr 20 02:22:53 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.gmdate"> <refnamediv> <refname>gmdate</refname> @@ -23,8 +23,10 @@ <title><function>gmdate</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php echo date ("M d Y H:i:s", mktime (0,0,0,1,1,2000)); echo gmdate ("M d Y H:i:s", mktime (0,0,0,1,1,2000)); +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/datetime/functions/gmmktime.xml diff -u phpdoc-zh/reference/datetime/functions/gmmktime.xml:1.3 phpdoc-zh/reference/datetime/functions/gmmktime.xml:1.4 --- phpdoc-zh/reference/datetime/functions/gmmktime.xml:1.3 Sun Sep 29 23:07:33 2002 +++ phpdoc-zh/reference/datetime/functions/gmmktime.xml Sun Apr 20 02:22:53 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.gmmktime"> <refnamediv> <refname>gmmktime</refname> @@ -11,16 +11,20 @@ <title>˵Ã÷</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>hour</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>minute</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>second</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>month</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>day</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>year</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>is_dst</parameter></methodparam> </methodsynopsis> <para> ºÍ <function>mktime</function> ÍêȫһÑù£¬Ö»³ýÁË·µ»ØÖµÊǸñÁÖÍþÖαê׼ʱµÄʱ¼ä´Á¡£ + </para> + <para> + ºÍ <function>mktime</function> + Ò»Ñù£¬²ÎÊý¿ÉÒÔ´ÓÓÒµ½×óÒÀ´Î¿Õ×Å£¬¿Õ×ŵIJÎÊý»á±»ÉèΪÏàÓ¦µÄµ±Ç° GMT Öµ¡£ </para> </refsect1> </refentry> Index: phpdoc-zh/reference/datetime/functions/gmstrftime.xml diff -u phpdoc-zh/reference/datetime/functions/gmstrftime.xml:1.3 phpdoc-zh/reference/datetime/functions/gmstrftime.xml:1.4 --- phpdoc-zh/reference/datetime/functions/gmstrftime.xml:1.3 Mon Feb 24 01:38:24 2003 +++ phpdoc-zh/reference/datetime/functions/gmstrftime.xml Sun Apr 20 02:22:53 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.gmstrftime"> <refnamediv> <refname>gmstrftime</refname> @@ -25,9 +25,11 @@ <title><function>gmstrftime</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php 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> Index: phpdoc-zh/reference/datetime/functions/localtime.xml diff -u phpdoc-zh/reference/datetime/functions/localtime.xml:1.2 phpdoc-zh/reference/datetime/functions/localtime.xml:1.3 --- phpdoc-zh/reference/datetime/functions/localtime.xml:1.2 Sun Sep 29 23:07:33 2002 +++ phpdoc-zh/reference/datetime/functions/localtime.xml Sun Apr 20 02:22:53 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.localtime"> <refnamediv> <refname>localtime</refname> @@ -21,7 +21,8 @@ <para> <function>localtime</function> º¯Êý·µ»ØÒ»¸öÊý×飬Æä½á¹¹ºÍ C º¯Êýµ÷Ó÷µ»ØµÄÍêȫһÑù¡£<function>localtime</function> - µÄµÚÒ»¸ö²ÎÊýÊÇʱ¼ä´Á£¬Èç¹ûûÓиø³öÔòʹÓõ±Ç°Ê±¼ä¡£µÚ¶þ¸ö²ÎÊýÊÇ + µÄµÚÒ»¸ö²ÎÊýÊÇʱ¼ä´Á£¬Èç¹ûûÓиø³öÔòʹÓÃ´Ó + <function>time</function> ·µ»ØµÄµ±Ç°Ê±¼ä¡£µÚ¶þ¸ö²ÎÊýÊÇ <parameter>is_associative</parameter>£¬Èç¹ûÉèΪ 0 »òδÌṩÔò·µ»ØµÄÊÇÆÕͨµÄÊý×ÖË÷ÒýÊý×é¡£Èç¹û¸Ã²ÎÊýÉèΪ 1 Ôò <function>localtime</function> º¯Êý·µ»Ø°üº¬ÓÐËùÓÐ´Ó Index: phpdoc-zh/reference/datetime/functions/microtime.xml diff -u phpdoc-zh/reference/datetime/functions/microtime.xml:1.2 phpdoc-zh/reference/datetime/functions/microtime.xml:1.3 --- phpdoc-zh/reference/datetime/functions/microtime.xml:1.2 Sun Sep 29 23:07:33 2002 +++ phpdoc-zh/reference/datetime/functions/microtime.xml Sun Apr 20 02:22:53 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.microtime"> <refnamediv> <refname>microtime</refname> @@ -25,6 +25,7 @@ <title><function>microtime</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php function getmicrotime(){ list($usec, $sec) = explode(" ",microtime()); return ((float)$usec + (float)$sec); @@ -40,6 +41,7 @@ $time = $time_end - $time_start; echo "Did nothing in $time seconds"; +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/datetime/functions/mktime.xml diff -u phpdoc-zh/reference/datetime/functions/mktime.xml:1.3 phpdoc-zh/reference/datetime/functions/mktime.xml:1.4 --- phpdoc-zh/reference/datetime/functions/mktime.xml:1.3 Wed Feb 26 02:58:59 2003 +++ phpdoc-zh/reference/datetime/functions/mktime.xml Sun Apr 20 02:22:53 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.mktime"> <refnamediv> <refname>mktime</refname> @@ -11,12 +11,12 @@ <title>˵Ã÷</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>hour</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>minute</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>second</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>month</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>day</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>year</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>is_dst</parameter></methodparam> </methodsynopsis> <para> @@ -53,10 +53,12 @@ <title><function>mktime</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php 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> @@ -81,11 +83,13 @@ <title>ÿ¸öÔµÄ×îºóÒ»Ìì</title> <programlisting role="php"> <![CDATA[ +<?php $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> Index: phpdoc-zh/reference/datetime/functions/strftime.xml diff -u phpdoc-zh/reference/datetime/functions/strftime.xml:1.4 phpdoc-zh/reference/datetime/functions/strftime.xml:1.5 --- phpdoc-zh/reference/datetime/functions/strftime.xml:1.4 Sun Jan 12 06:01:01 2003 +++ phpdoc-zh/reference/datetime/functions/strftime.xml Sun Apr 20 02:22:53 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> <refentry id="function.strftime"> <refnamediv> <refname>strftime</refname> @@ -223,6 +223,7 @@ <title><function>strftime</function> ÇøÓòµÄÀý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php setlocale (LC_TIME, "C"); print (strftime ("%A in Finnish is ")); setlocale (LC_TIME, "fi_FI"); @@ -231,6 +232,7 @@ print (strftime ("%A and in German ")); setlocale (LC_TIME, "de_DE"); print (strftime ("%A.\n")); +?> ]]> </programlisting> </example> Index: phpdoc-zh/reference/datetime/functions/strtotime.xml diff -u phpdoc-zh/reference/datetime/functions/strtotime.xml:1.3 phpdoc-zh/reference/datetime/functions/strtotime.xml:1.4 --- phpdoc-zh/reference/datetime/functions/strtotime.xml:1.3 Sun Sep 29 23:07:33 2002 +++ phpdoc-zh/reference/datetime/functions/strtotime.xml Sun Apr 20 02:22:53 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.strtotime"> <refnamediv> <refname>strtotime</refname> @@ -33,6 +33,7 @@ <title><function>strtotime</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ +<?php echo strtotime ("now"), "\n"; echo strtotime ("10 September 2000"), "\n"; echo strtotime ("+1 day"), "\n"; @@ -40,6 +41,7 @@ echo strtotime ("+1 week 2 days 4 hours 2 seconds"), "\n"; echo strtotime ("next Thursday"), "\n"; echo strtotime ("last Monday"), "\n"; +?> ]]> </programlisting> </example> @@ -49,12 +51,14 @@ <title>¼ì²éʧ°Ü</title> <programlisting role="php"> <![CDATA[ +<?php $str = 'Not Good'; if (($timestamp = strtotime($str)) === -1) { echo "The string ($str) is bogus"; } else { echo "$str == ". date('l dS of F Y h:i:s A',$timestamp); } +?> ]]> </programlisting> </example>
« previous php.doc.zh (#1350) next »