cvs: phpdoc-zh /reference/datetime/functions gmmktime.xml gmstrftime.xml microtime.xml mktime.xml strftime.xml strtotime.xml time.xml
| From: | Dallas Thunder | Date: | Fri, 20 Sep 2002 08:04:16 +0000 |
| Subject: | cvs: phpdoc-zh /reference/datetime/functions gmmktime.xml gmstrftime.xml microtime.xml mktime.xml strftime.xml strtotime.xml time.xml | ||
| Groups: | php.doc.zh | ||
| Request: | Send a blank email to doc-zh+get-616@lists.php.net to get a copy of this message | ||
dallas Fri Sep 20 04:04:16 2002 EDT
Added files:
/phpdoc-zh/reference/datetime/functions gmmktime.xml gmstrftime.xml
microtime.xml mktime.xml
strftime.xml strtotime.xml
time.xml
Log:
Translation completed.
Index: phpdoc-zh/reference/datetime/functions/gmmktime.xml +++ phpdoc-zh/reference/datetime/functions/gmmktime.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.gmmktime"> <refnamediv> <refname>gmmktime</refname> <refpurpose>È¡µÃ GMT ÈÕÆÚµÄ UNIX ʱ¼ä´Á</refpurpose> </refnamediv> <refsect1> <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>is_dst</parameter></methodparam> </methodsynopsis> <para> ºÍ <function>mktime</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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/datetime/functions/gmstrftime.xml +++ phpdoc-zh/reference/datetime/functions/gmstrftime.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.gmstrftime"> <refnamediv> <refname>gmstrftime</refname> <refpurpose> ¸ù¾ÝÇøÓòÉèÖøñʽ»¯ GMT/CUT ʱ¼ä£¯ÈÕÆÚ </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</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> ºÍ <function>strftime</function> µÄÐÐΪÏàͬ£¬Ö»³ýÁË·µ»ØÊ±¼äÊǸñÁÖÍþÖαê׼ʱ£¨GMT£©¡£ÀýÈ磬µ±ÔÚ¶«²¿±ê׼ʱ£¨EST£¬GMT -500£©ÔËÐÐʱ£¬ÏÂÃæµÚÒ»ÐÐÏÔʾ¡°Dec 31 1998 20:00:00¡±£¬¶øµÚ¶þÐÐÏÔʾ¡°Jan 01 1999 01:00:00¡±¡£ <example> <title><function>gmstrftime</function> Àý×Ó</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> ²Î¼û <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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/datetime/functions/microtime.xml +++ phpdoc-zh/reference/datetime/functions/microtime.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.microtime"> <refnamediv> <refname>microtime</refname> <refpurpose> ·µ»Øµ±Ç° UNIX ʱ¼ä´ÁºÍ΢ÃëÊý</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>microtime</methodname> <void/> </methodsynopsis> <para> ·µ»Ø¸ñʽΪ¡°msec sec¡±µÄ×Ö·û´®£¬ÆäÖÐ sec Êǵ±Ç°µÄ Unix ʱ¼ä´Á£¬msec ÊÇ΢Ã벿·Ö¡£±¾º¯Êý½öÔÚÖ§³Ö gettimeofday() ϵͳµ÷ÓõIJÙ×÷ϵͳÏ¿ÉÓᣠ</para> <para> ×Ö·û´®µÄÁ½²¿·Ö¶¼ÊÇÒÔÃëΪµ¥Î»·µ»ØµÄ¡£ <example> <title><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++){ //do nothing, 1000 times } $time_end = getmicrotime(); $time = $time_end - $time_start; echo "Did nothing in $time seconds"; ]]> </programlisting> </example> </para> <para> ²Î¼û <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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/datetime/functions/mktime.xml +++ phpdoc-zh/reference/datetime/functions/mktime.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.mktime"> <refnamediv> <refname>mktime</refname> <refpurpose>È¡µÃÒ»¸öÈÕÆÚµÄ UNIX ʱ¼ä´Á</refpurpose> </refnamediv> <refsect1> <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>is_dst</parameter></methodparam> </methodsynopsis> <para> <emphasis>¾¯¸æ£º</emphasis>×¢Òâ²ÎÊýµÄÆæ¹Ö˳Ðò£¬ÕâºÍ±ê×¼µÄ UNIX mktime() µ÷ÓÃÖеIJÎÊý˳Ðò²»Í¬¡£Ôڽű¾¾³£»á»ìÏýÕâЩֵ¶ø³ö´í¡£ <!-- ²»Ì«ºÃ·£¬ÔÎÄÁô×Å¡£ Note the strange order of arguments, which differs from the order of arguments in a regular UNIX mktime() call and which does not lend itself well to leaving out parameters from right to left (see below). It is a common error to mix these values up in a script. --> </para> <para> ¸ù¾Ý¸ø³öµÄ²ÎÊý·µ»Ø Unix ʱ¼ä´Á¡£Ê±¼ä´ÁÊÇÒ»¸ö³¤ÕûÊý£¬°üº¬ÁË´Ó Unix мÍÔª£¨1970 Äê 1 Ô 1 ÈÕ£©µ½¸ø¶¨Ê±¼äµÄÃëÊý¡£ </para> <para> ²ÎÊý¿ÉÒÔ´ÓÓÒÏò×óÊ¡ÂÔ£¬ÈκÎÊ¡ÂԵIJÎÊý»á±»ÉèÖóɱ¾µØÈÕÆÚºÍʱ¼äµÄµ±Ç°Öµ¡£ </para> <para> <parameter>is_dst</parameter> ÔÚÏÄÁîʱ¿ÉÒÔ±»ÉèΪ 1£¬Èç¹û²»ÊÇÔòÉèΪ 0£¬»òÕß²»ÖªµÀÊÇ·ñΪÏÄÁîʱµÄ»°ÉèΪ -1£¨Ä¬ÈÏÖµ£©¡£Èç¹û²»ÖªµÀ£¬PHP »á³¢ÊÔ×Ô¼ºÅжϡ£Õâ¿ÉÄÜ»á²úÉúδԤÆÚ£¨µ«²»ÊÇ´íÎ󣩵Ľá¹û¡£ </para> <note> <para> <parameter>is_dst</parameter> ÊÇ 3.0.10 °æÐ¼ӵġ£ </para> </note> <para> <function>mktime</function> ¿ÉÒÔÓÃÀ´×öÈÕÆÚ¼ÆËãºÍÑéÖ¤£¬¶ÔÓÚ³¬³ö·¶Î§µÄÊäÈëËü¿ÉÒÔ×Ô¶¯¼ÆËã³öÕýÈ·µÄÖµÀ´¡£ÀýÈ磬ÏÂÃæµÄÿһÐж¼»áÊä³ö×Ö·û´®¡°Jan-01-1998¡±¡£ <example> <title><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> ¿ÉÒÔÊÇÁ½Î»»òËÄλÊý×Ö£¬È¡Öµ´Ó 0-69 ±íʾ 2000-2069 ÒÔ¼° 70-99 ±íʾ 1970-1999£¨ÔÚÈç½ñºÜ³£¼ûµÄ time_t ÊÇ 32 λÓзûºÅÕûÊýµÄϵͳÖУ¬<parameter>year</parameter> µÄÓÐЧ·¶Î§ÊÇ 1902 µ½ 2037£©¡£ </para> <para> ¸ø¶¨Ô·ݵÄ×îºóÒ»Ìì¿ÉÒÔ±í´ïΪϸöÔÂµÄµÚ "0" Ì죬¶ø²»ÊÇ -1 Ìì¡£ÏÂÃæÁ½¸öÀý×Ó¶¼½«²úÉú×Ö·û´®¡°The last day in Feb 2000 is: 29¡±¡£ <example> <title>ÿ¸öÔµÄ×îºóÒ»Ìì</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> Ä꣬Ô£¬ÈÕ¶¼µÈÓÚÁãµÄÈÕÆÚ±»ÈÏΪÊÇ·Ç·¨µÄ£¨·ñÔò»á±»µ±×÷ 30.11.1999£¬ÕâÊǺֵܹÄÐÐΪ£©¡£ </simpara> <para> ²Î¼û <function>date</function> ºÍ <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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/datetime/functions/strftime.xml +++ phpdoc-zh/reference/datetime/functions/strftime.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.strftime"> <refnamediv> <refname>strftime</refname> <refpurpose> ¸ù¾ÝÇøÓòÉèÖøñʽ»¯±¾µØÊ±¼ä£¯ÈÕÆÚ </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>strftime</methodname> <methodparam><type>string</type><parameter>format</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter> timestamp </parameter></methodparam> </methodsynopsis> <para> ·µ»ØÓøø¶¨µÄ¸ñʽ×Ö´®¶Ô¸ø³öµÄ <parameter>timestamp</parameter> ½øÐиñʽÊä³öºóµÄ×Ö·û´®¡£Èç¹ûûÓиø³öʱ¼ä´ÁÔòÓõ±Ç°µÄ±¾µØÊ±¼ä¡£Ô·ݺÍÐÇÆÚ¼¸ÒÔ¼°ÆäËüºÍÓïÑÔÓйصÄ×Ö·û´®Ð´·¨ºÍÓà <function>setlocale</function> É趨µÄµ±Ç°µÄÇøÓòÓйء£ </para> <para> ¸ñʽ×Ö´®ÄÜʶ±ðÏÂÁÐת»»±ê¼Ç£º <itemizedlist> <listitem> <simpara> %a - µ±Ç°ÇøÓòÐÇÆÚ¼¸µÄ¼òд </simpara> </listitem> <listitem> <simpara> %A - µ±Ç°ÇøÓòÐÇÆÚ¼¸µÄÈ«³Æ </simpara> </listitem> <listitem> <simpara> %b - µ±Ç°ÇøÓòÔ·ݵļòд </simpara> </listitem> <listitem> <simpara> %B - µ±Ç°ÇøÓòÔ·ݵÄÈ«³Æ </simpara> </listitem> <listitem> <simpara> %c - µ±Ç°ÇøÓòÊ×Ñ¡µÄÈÕÆÚʱ¼ä±í´ï </simpara> </listitem> <listitem> <simpara> %C - ÊÀ¼ÍÖµ£¨Äê·Ý³ýÒÔ 100 ºóÈ¡Õû£¬·¶Î§´Ó 00 µ½ 99£© </simpara> </listitem> <listitem> <simpara> %d - Ô·ÝÖеĵڼ¸Ì죬ʮ½øÖÆÊý×Ö£¨·¶Î§´Ó 01 µ½ 31£© </simpara> </listitem> <listitem> <simpara> %D - ºÍ %m/%d/%y Ò»Ñù </simpara> </listitem> <listitem> <simpara> %e - Ô·ÝÖеĵڼ¸Ì죬ʮ½øÖÆÊý×Ö£¬Ò»Î»µÄÊý×Öǰ»á¼ÓÉÏÒ»¸ö¿Õ¸ñ£¨·¶Î§´Ó ' 1' µ½ '31'£© </simpara> </listitem> <listitem> <simpara> %g - ºÍ %G Ò»Ñù£¬µ«ÊÇûÓÐÊÀ¼Í </simpara> </listitem> <listitem> <simpara> %G - 4 λÊýµÄÄê·Ý£¬·ûºÏ ISO ÐÇÆÚÊý£¨²Î¼û %V£©¡£ºÍ %V µÄ¸ñʽºÍÖµÒ»Ñù£¬Ö»³ýÁËÈç¹û ISO ÐÇÆÚÊýÊôÓÚǰһÄê»òÕߺóÒ»Ä꣬ÔòʹÓÃÄÇÒ»Äê¡£ </simpara> </listitem> <listitem> <simpara> %h - ºÍ %b Ò»Ñù </simpara> </listitem> <listitem> <simpara> %H - 24 Ð¡Ê±ÖÆµÄÊ®½øÖÆÐ¡Ê±Êý£¨·¶Î§´Ó 00 µ½ 23£© </simpara> </listitem> <listitem> <simpara> %I - 12 Ð¡Ê±ÖÆµÄÊ®½øÖÆÐ¡Ê±Êý£¨·¶Î§´Ó 00 µ½ 12£© </simpara> </listitem> <listitem> <simpara> %j - Äê·ÝÖеĵڼ¸Ì죬ʮ½øÖÆÊý£¨·¶Î§´Ó 001 µ½ 366£© </simpara> </listitem> <listitem> <simpara> %m - Ê®½øÖÆÔ·ݣ¨·¶Î§´Ó 01 µ½ 12£© </simpara> </listitem> <listitem> <simpara> %M - Ê®½øÖÆ·ÖÖÓÊý </simpara> </listitem> <listitem> <simpara> %n - »»Ðзû </simpara> </listitem> <listitem> <simpara> %p - ¸ù¾Ý¸ø¶¨µÄʱ¼äֵΪ `am' »ò `pm'£¬»òÕßµ±Ç°ÇøÓòÉèÖÃÖеÄÏàÓ¦×Ö·û´® </simpara> </listitem> <listitem> <simpara> %r - Óà a.m. ºÍ p.m. ·ûºÅµÄʱ¼ä </simpara> </listitem> <listitem> <simpara> %R - 24 Сʱ·ûºÅµÄʱ¼ä </simpara> </listitem> <listitem> <simpara> %S - Ê®½øÖÆÃëÊý </simpara> </listitem> <listitem> <simpara> %t - ÖÆ±í·û </simpara> </listitem> <listitem> <simpara> %T - µ±Ç°Ê±¼ä£¬ºÍ %H:%M:%S Ò»Ñù </simpara> </listitem> <listitem> <simpara> %u - ÐÇÆÚ¼¸µÄÊ®½øÖÆÊý±í´ï [1,7]£¬1 ±íʾÐÇÆÚÒ» </simpara> <warning> <simpara> ¾¡¹Ü ISO 9889:1999£¨µ±Ç°µÄ C ±ê×¼£©Ã÷È·Ö¸³öÒ»ÖÜ´ÓÐÇÆÚÒ»¿ªÊ¼£¬µ«ÊÇ Sun Solaris µÄÒ»ÖÜËÆºõ´ÓÐÇÆÚÌ쿪ʼ²¢×÷Ϊ 1¡£ </simpara> </warning> </listitem> <listitem> <simpara> %U - ±¾ÄêµÄµÚ¼¸ÖÜ£¬´ÓµÚÒ»ÖܵĵÚÒ»¸öÐÇÆÚÌì×÷ΪµÚÒ»Ì쿪ʼ </simpara> </listitem> <listitem> <simpara> %V - ±¾ÄêµÚ¼¸ÖÜµÄ ISO 8601:1988 ¸ñʽ£¬·¶Î§´Ó 01 µ½ 53£¬µÚ 1 ÖÜÊDZ¾ÄêµÚÒ»¸öÖÁÉÙ»¹ÓÐ 4 ÌìµÄÐÇÆÚ£¬ÐÇÆÚÒ»×÷ΪÿÖܵĵÚÒ»Ìì¡££¨Óà %G »òÕß %g ×÷Ϊָ¶¨Ê±¼ä´ÁÏàÓ¦ÖÜÊýµÄÄê·Ý×é³É¡££© </simpara> </listitem> <listitem> <simpara> %W - ±¾ÄêµÄµÚ¼¸ÖÜÊý£¬´ÓµÚÒ»ÖܵĵÚÒ»¸öÐÇÆÚÒ»×÷ΪµÚÒ»Ì쿪ʼ </simpara> </listitem> <listitem> <simpara> %w - ÐÇÆÚÖеĵڼ¸Ì죬ÐÇÆÚÌìΪ 0 </simpara> </listitem> <listitem> <simpara> %x - µ±Ç°ÇøÓòÊ×Ñ¡µÄʱ¼ä±íʾ·¨£¬²»°üÀ¨Ê±¼ä </simpara> </listitem> <listitem> <simpara> %X - µ±Ç°ÇøÓòÊ×Ñ¡µÄʱ¼ä±íʾ·¨£¬²»°üÀ¨ÈÕÆÚ </simpara> </listitem> <listitem> <simpara> %y - ûÓÐÊÀ¼ÍÊýµÄÊ®½øÖÆÄê·Ý£¨·¶Î§´Ó 00 µ½ 99£© </simpara> </listitem> <listitem> <simpara> %Y - °üÀ¨ÊÀ¼ÍÊýµÄÊ®½øÖÆÄê·Ý </simpara> </listitem> <listitem> <simpara> %Z - Ê±ÇøÃû»òËõд </simpara> </listitem> <listitem> <simpara> %% - ÎÄ×ÖÉ쵀 `%' ×Ö·û </simpara> </listitem> </itemizedlist> <note> <para> ¿ÉÄܲ»ÊÇËùÓеÄת»»±ê¼Ç¶¼±» C ¿âÎļþÖ§³Ö£¬ÕâÖÖÇé¿öÏ PHP µÄ <function>strftime</function> Ò²²»Ö§³Ö¡£ÕâÒâζ×ÅÀýÈç %e, %T ºÍ %D£¨¿ÉÄܸü¶à£©ÔÚ Windows ϲ»Æð×÷Óᣠ</para> </note> <example> <title><function>strftime</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ setlocale (LC_TIME, "C"); print (strftime ("%A in Finnish is ")); setlocale (LC_TIME, "fi_FI"); print (strftime ("%A, in French ")); setlocale (LC_TIME, "fr_FR"); print (strftime ("%A and in German ")); setlocale (LC_TIME, "de_DE"); print (strftime ("%A.\n")); ]]> </programlisting> </example> ±¾ÀýÔÚÄãµÄϵͳÖа²×°Óи÷×ÔµÄÇøÓòÉèÖúó²ÅÄܹ¤×÷¡£ </para> <para> ²Î¼û <function>setlocale</function> ºÍ <function>mktime</function> ÒÔ¼° <ulink url="&spec.strftime;">Open Group specification of <function>strftime</function></ulink>¡£ </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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/datetime/functions/strtotime.xml +++ phpdoc-zh/reference/datetime/functions/strtotime.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- splitted from ./en/functions/datetime.xml, last change in rev 1.8 --> <refentry id="function.strtotime"> <refnamediv> <refname>strtotime</refname> <refpurpose> ½«ÈκÎÓ¢ÎÄÎı¾µÄÈÕÆÚʱ¼äÃèÊö½âÎöΪ UNIX ʱ¼ä´Á </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>int</type><methodname>strtotime</methodname> <methodparam><type>string</type><parameter>time</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>now</parameter></methodparam> </methodsynopsis> <simpara> ±¾º¯ÊýÔ¤ÆÚ½ÓÊÜÒ»¸ö°üº¬Ó¢ÎÄÈÕÆÚ¸ñʽµÄ×Ö·û´®²¢³¢ÊÔ½«Æä½âÎöΪ UNIX ʱ¼ä´Á¡£Èç¹û time µÄ¸ñʽÊǾø¶Ôʱ¼äÔò now ²ÎÊý²»Æð×÷Óá£Èç¹û time µÄ¸ñʽÊÇÏà¶Ôʱ¼äÔòÆäËùÏà¶ÔµÄʱ¼äÓÉ now Ìṩ£¬»òÕßÈç¹ûδÌṩ now ²ÎÊýʱÓõ±Ç°Ê±¼ä¡£Ê§°Üʱ·µ»Ø <literal>-1</literal>¡£ </simpara> <simpara> ÒòΪ <function>strtotime</function> µÄÐÐΪÊÇÒÀÕÕ GNU ÈÕÆÚÓï·¨µÄ£¬Òò´ËÇë¿´¿´ GNU ÊÖ²áÖÐµÄ <ulink url="&url.gnu.man.date-input;">Date Input Formats</ulink>¡£ÕâÀï¼ÇÊöÁË <parameter>time</parameter> ²ÎÊýµÄºÏ·¨Óï·¨¡£ </simpara> <para> <example> <title><function>strtotime</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ echo strtotime ("now"), "\n"; echo strtotime ("10 September 2000"), "\n"; echo strtotime ("+1 day"), "\n"; echo strtotime ("+1 week"), "\n"; echo strtotime ("+1 week 2 days 4 hours 2 seconds"), "\n"; echo strtotime ("next Thursday"), "\n"; echo strtotime ("last Monday"), "\n"; ]]> </programlisting> </example> </para> <para> <example> <title>¼ì²éʧ°Ü</title> <programlisting role="php"> <![CDATA[ $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> </para> <note> <para> ÓÐЧµÄʱ¼ä´ÁµäÐÍ·¶Î§ÊÇ´Ó¸ñÁÖÍþÖÎʱ¼ä 1901 Äê 12 Ô 13 ÈÕ ÐÇÆÚÎå 20:45:54 µ½ 2038Äê 1 Ô 19 ÈÕ ÐÇÆÚ¶þ 03:14:07¡££¨¸ÃÈÕÆÚ¸ù¾Ý 32 λÓзûºÅÕûÊýµÄ×îСֵºÍ×î´óÖµ¶øÀ´¡££© </para> </note> </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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/datetime/functions/time.xml +++ phpdoc-zh/reference/datetime/functions/time.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 --> <refentry id="function.time"> <refnamediv> <refname>time</refname> <refpurpose>·µ»Øµ±Ç°µÄ UNIX ʱ¼ä´Á</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>int</type><methodname>time</methodname> <void/> </methodsynopsis> <para> ·µ»Ø×Ô´Ó Unix мÍÔª£¨¸ñÁÖÍþÖÎʱ¼ä 1970 Äê 1 Ô 1 ÈÕ 00:00:00£©µ½µ±Ç°Ê±¼äµÄÃëÊý¡£ </para> <para> ²Î¼û <function>date</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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
Index: phpdoc-zh/reference/datetime/functions/gmmktime.xml +++ phpdoc-zh/reference/datetime/functions/gmmktime.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.gmmktime"> <refnamediv> <refname>gmmktime</refname> <refpurpose>È¡µÃ GMT ÈÕÆÚµÄ UNIX ʱ¼ä´Á</refpurpose> </refnamediv> <refsect1> <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>is_dst</parameter></methodparam> </methodsynopsis> <para> ºÍ <function>mktime</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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/datetime/functions/gmstrftime.xml +++ phpdoc-zh/reference/datetime/functions/gmstrftime.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.gmstrftime"> <refnamediv> <refname>gmstrftime</refname> <refpurpose> ¸ù¾ÝÇøÓòÉèÖøñʽ»¯ GMT/CUT ʱ¼ä£¯ÈÕÆÚ </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</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> ºÍ <function>strftime</function> µÄÐÐΪÏàͬ£¬Ö»³ýÁË·µ»ØÊ±¼äÊǸñÁÖÍþÖαê׼ʱ£¨GMT£©¡£ÀýÈ磬µ±ÔÚ¶«²¿±ê׼ʱ£¨EST£¬GMT -500£©ÔËÐÐʱ£¬ÏÂÃæµÚÒ»ÐÐÏÔʾ¡°Dec 31 1998 20:00:00¡±£¬¶øµÚ¶þÐÐÏÔʾ¡°Jan 01 1999 01:00:00¡±¡£ <example> <title><function>gmstrftime</function> Àý×Ó</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> ²Î¼û <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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/datetime/functions/microtime.xml +++ phpdoc-zh/reference/datetime/functions/microtime.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.microtime"> <refnamediv> <refname>microtime</refname> <refpurpose> ·µ»Øµ±Ç° UNIX ʱ¼ä´ÁºÍ΢ÃëÊý</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>microtime</methodname> <void/> </methodsynopsis> <para> ·µ»Ø¸ñʽΪ¡°msec sec¡±µÄ×Ö·û´®£¬ÆäÖÐ sec Êǵ±Ç°µÄ Unix ʱ¼ä´Á£¬msec ÊÇ΢Ã벿·Ö¡£±¾º¯Êý½öÔÚÖ§³Ö gettimeofday() ϵͳµ÷ÓõIJÙ×÷ϵͳÏ¿ÉÓᣠ</para> <para> ×Ö·û´®µÄÁ½²¿·Ö¶¼ÊÇÒÔÃëΪµ¥Î»·µ»ØµÄ¡£ <example> <title><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++){ //do nothing, 1000 times } $time_end = getmicrotime(); $time = $time_end - $time_start; echo "Did nothing in $time seconds"; ]]> </programlisting> </example> </para> <para> ²Î¼û <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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/datetime/functions/mktime.xml +++ phpdoc-zh/reference/datetime/functions/mktime.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.2 Maintainer: dallas Status: ready --> <refentry id="function.mktime"> <refnamediv> <refname>mktime</refname> <refpurpose>È¡µÃÒ»¸öÈÕÆÚµÄ UNIX ʱ¼ä´Á</refpurpose> </refnamediv> <refsect1> <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>is_dst</parameter></methodparam> </methodsynopsis> <para> <emphasis>¾¯¸æ£º</emphasis>×¢Òâ²ÎÊýµÄÆæ¹Ö˳Ðò£¬ÕâºÍ±ê×¼µÄ UNIX mktime() µ÷ÓÃÖеIJÎÊý˳Ðò²»Í¬¡£Ôڽű¾¾³£»á»ìÏýÕâЩֵ¶ø³ö´í¡£ <!-- ²»Ì«ºÃ·£¬ÔÎÄÁô×Å¡£ Note the strange order of arguments, which differs from the order of arguments in a regular UNIX mktime() call and which does not lend itself well to leaving out parameters from right to left (see below). It is a common error to mix these values up in a script. --> </para> <para> ¸ù¾Ý¸ø³öµÄ²ÎÊý·µ»Ø Unix ʱ¼ä´Á¡£Ê±¼ä´ÁÊÇÒ»¸ö³¤ÕûÊý£¬°üº¬ÁË´Ó Unix мÍÔª£¨1970 Äê 1 Ô 1 ÈÕ£©µ½¸ø¶¨Ê±¼äµÄÃëÊý¡£ </para> <para> ²ÎÊý¿ÉÒÔ´ÓÓÒÏò×óÊ¡ÂÔ£¬ÈκÎÊ¡ÂԵIJÎÊý»á±»ÉèÖóɱ¾µØÈÕÆÚºÍʱ¼äµÄµ±Ç°Öµ¡£ </para> <para> <parameter>is_dst</parameter> ÔÚÏÄÁîʱ¿ÉÒÔ±»ÉèΪ 1£¬Èç¹û²»ÊÇÔòÉèΪ 0£¬»òÕß²»ÖªµÀÊÇ·ñΪÏÄÁîʱµÄ»°ÉèΪ -1£¨Ä¬ÈÏÖµ£©¡£Èç¹û²»ÖªµÀ£¬PHP »á³¢ÊÔ×Ô¼ºÅжϡ£Õâ¿ÉÄÜ»á²úÉúδԤÆÚ£¨µ«²»ÊÇ´íÎ󣩵Ľá¹û¡£ </para> <note> <para> <parameter>is_dst</parameter> ÊÇ 3.0.10 °æÐ¼ӵġ£ </para> </note> <para> <function>mktime</function> ¿ÉÒÔÓÃÀ´×öÈÕÆÚ¼ÆËãºÍÑéÖ¤£¬¶ÔÓÚ³¬³ö·¶Î§µÄÊäÈëËü¿ÉÒÔ×Ô¶¯¼ÆËã³öÕýÈ·µÄÖµÀ´¡£ÀýÈ磬ÏÂÃæµÄÿһÐж¼»áÊä³ö×Ö·û´®¡°Jan-01-1998¡±¡£ <example> <title><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> ¿ÉÒÔÊÇÁ½Î»»òËÄλÊý×Ö£¬È¡Öµ´Ó 0-69 ±íʾ 2000-2069 ÒÔ¼° 70-99 ±íʾ 1970-1999£¨ÔÚÈç½ñºÜ³£¼ûµÄ time_t ÊÇ 32 λÓзûºÅÕûÊýµÄϵͳÖУ¬<parameter>year</parameter> µÄÓÐЧ·¶Î§ÊÇ 1902 µ½ 2037£©¡£ </para> <para> ¸ø¶¨Ô·ݵÄ×îºóÒ»Ìì¿ÉÒÔ±í´ïΪϸöÔÂµÄµÚ "0" Ì죬¶ø²»ÊÇ -1 Ìì¡£ÏÂÃæÁ½¸öÀý×Ó¶¼½«²úÉú×Ö·û´®¡°The last day in Feb 2000 is: 29¡±¡£ <example> <title>ÿ¸öÔµÄ×îºóÒ»Ìì</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> Ä꣬Ô£¬ÈÕ¶¼µÈÓÚÁãµÄÈÕÆÚ±»ÈÏΪÊÇ·Ç·¨µÄ£¨·ñÔò»á±»µ±×÷ 30.11.1999£¬ÕâÊǺֵܹÄÐÐΪ£©¡£ </simpara> <para> ²Î¼û <function>date</function> ºÍ <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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/datetime/functions/strftime.xml +++ phpdoc-zh/reference/datetime/functions/strftime.xml <?xml version="1.0" encoding="gb2312"?> <!-- $Revision: 1.1 $ --> <!-- $Author: dallas $ --> <!-- EN-Revision: 1.3 Maintainer: dallas Status: ready --> <refentry id="function.strftime"> <refnamediv> <refname>strftime</refname> <refpurpose> ¸ù¾ÝÇøÓòÉèÖøñʽ»¯±¾µØÊ±¼ä£¯ÈÕÆÚ </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>string</type><methodname>strftime</methodname> <methodparam><type>string</type><parameter>format</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter> timestamp </parameter></methodparam> </methodsynopsis> <para> ·µ»ØÓøø¶¨µÄ¸ñʽ×Ö´®¶Ô¸ø³öµÄ <parameter>timestamp</parameter> ½øÐиñʽÊä³öºóµÄ×Ö·û´®¡£Èç¹ûûÓиø³öʱ¼ä´ÁÔòÓõ±Ç°µÄ±¾µØÊ±¼ä¡£Ô·ݺÍÐÇÆÚ¼¸ÒÔ¼°ÆäËüºÍÓïÑÔÓйصÄ×Ö·û´®Ð´·¨ºÍÓà <function>setlocale</function> É趨µÄµ±Ç°µÄÇøÓòÓйء£ </para> <para> ¸ñʽ×Ö´®ÄÜʶ±ðÏÂÁÐת»»±ê¼Ç£º <itemizedlist> <listitem> <simpara> %a - µ±Ç°ÇøÓòÐÇÆÚ¼¸µÄ¼òд </simpara> </listitem> <listitem> <simpara> %A - µ±Ç°ÇøÓòÐÇÆÚ¼¸µÄÈ«³Æ </simpara> </listitem> <listitem> <simpara> %b - µ±Ç°ÇøÓòÔ·ݵļòд </simpara> </listitem> <listitem> <simpara> %B - µ±Ç°ÇøÓòÔ·ݵÄÈ«³Æ </simpara> </listitem> <listitem> <simpara> %c - µ±Ç°ÇøÓòÊ×Ñ¡µÄÈÕÆÚʱ¼ä±í´ï </simpara> </listitem> <listitem> <simpara> %C - ÊÀ¼ÍÖµ£¨Äê·Ý³ýÒÔ 100 ºóÈ¡Õû£¬·¶Î§´Ó 00 µ½ 99£© </simpara> </listitem> <listitem> <simpara> %d - Ô·ÝÖеĵڼ¸Ì죬ʮ½øÖÆÊý×Ö£¨·¶Î§´Ó 01 µ½ 31£© </simpara> </listitem> <listitem> <simpara> %D - ºÍ %m/%d/%y Ò»Ñù </simpara> </listitem> <listitem> <simpara> %e - Ô·ÝÖеĵڼ¸Ì죬ʮ½øÖÆÊý×Ö£¬Ò»Î»µÄÊý×Öǰ»á¼ÓÉÏÒ»¸ö¿Õ¸ñ£¨·¶Î§´Ó ' 1' µ½ '31'£© </simpara> </listitem> <listitem> <simpara> %g - ºÍ %G Ò»Ñù£¬µ«ÊÇûÓÐÊÀ¼Í </simpara> </listitem> <listitem> <simpara> %G - 4 λÊýµÄÄê·Ý£¬·ûºÏ ISO ÐÇÆÚÊý£¨²Î¼û %V£©¡£ºÍ %V µÄ¸ñʽºÍÖµÒ»Ñù£¬Ö»³ýÁËÈç¹û ISO ÐÇÆÚÊýÊôÓÚǰһÄê»òÕߺóÒ»Ä꣬ÔòʹÓÃÄÇÒ»Äê¡£ </simpara> </listitem> <listitem> <simpara> %h - ºÍ %b Ò»Ñù </simpara> </listitem> <listitem> <simpara> %H - 24 Ð¡Ê±ÖÆµÄÊ®½øÖÆÐ¡Ê±Êý£¨·¶Î§´Ó 00 µ½ 23£© </simpara> </listitem> <listitem> <simpara> %I - 12 Ð¡Ê±ÖÆµÄÊ®½øÖÆÐ¡Ê±Êý£¨·¶Î§´Ó 00 µ½ 12£© </simpara> </listitem> <listitem> <simpara> %j - Äê·ÝÖеĵڼ¸Ì죬ʮ½øÖÆÊý£¨·¶Î§´Ó 001 µ½ 366£© </simpara> </listitem> <listitem> <simpara> %m - Ê®½øÖÆÔ·ݣ¨·¶Î§´Ó 01 µ½ 12£© </simpara> </listitem> <listitem> <simpara> %M - Ê®½øÖÆ·ÖÖÓÊý </simpara> </listitem> <listitem> <simpara> %n - »»Ðзû </simpara> </listitem> <listitem> <simpara> %p - ¸ù¾Ý¸ø¶¨µÄʱ¼äֵΪ `am' »ò `pm'£¬»òÕßµ±Ç°ÇøÓòÉèÖÃÖеÄÏàÓ¦×Ö·û´® </simpara> </listitem> <listitem> <simpara> %r - Óà a.m. ºÍ p.m. ·ûºÅµÄʱ¼ä </simpara> </listitem> <listitem> <simpara> %R - 24 Сʱ·ûºÅµÄʱ¼ä </simpara> </listitem> <listitem> <simpara> %S - Ê®½øÖÆÃëÊý </simpara> </listitem> <listitem> <simpara> %t - ÖÆ±í·û </simpara> </listitem> <listitem> <simpara> %T - µ±Ç°Ê±¼ä£¬ºÍ %H:%M:%S Ò»Ñù </simpara> </listitem> <listitem> <simpara> %u - ÐÇÆÚ¼¸µÄÊ®½øÖÆÊý±í´ï [1,7]£¬1 ±íʾÐÇÆÚÒ» </simpara> <warning> <simpara> ¾¡¹Ü ISO 9889:1999£¨µ±Ç°µÄ C ±ê×¼£©Ã÷È·Ö¸³öÒ»ÖÜ´ÓÐÇÆÚÒ»¿ªÊ¼£¬µ«ÊÇ Sun Solaris µÄÒ»ÖÜËÆºõ´ÓÐÇÆÚÌ쿪ʼ²¢×÷Ϊ 1¡£ </simpara> </warning> </listitem> <listitem> <simpara> %U - ±¾ÄêµÄµÚ¼¸ÖÜ£¬´ÓµÚÒ»ÖܵĵÚÒ»¸öÐÇÆÚÌì×÷ΪµÚÒ»Ì쿪ʼ </simpara> </listitem> <listitem> <simpara> %V - ±¾ÄêµÚ¼¸ÖÜµÄ ISO 8601:1988 ¸ñʽ£¬·¶Î§´Ó 01 µ½ 53£¬µÚ 1 ÖÜÊDZ¾ÄêµÚÒ»¸öÖÁÉÙ»¹ÓÐ 4 ÌìµÄÐÇÆÚ£¬ÐÇÆÚÒ»×÷ΪÿÖܵĵÚÒ»Ìì¡££¨Óà %G »òÕß %g ×÷Ϊָ¶¨Ê±¼ä´ÁÏàÓ¦ÖÜÊýµÄÄê·Ý×é³É¡££© </simpara> </listitem> <listitem> <simpara> %W - ±¾ÄêµÄµÚ¼¸ÖÜÊý£¬´ÓµÚÒ»ÖܵĵÚÒ»¸öÐÇÆÚÒ»×÷ΪµÚÒ»Ì쿪ʼ </simpara> </listitem> <listitem> <simpara> %w - ÐÇÆÚÖеĵڼ¸Ì죬ÐÇÆÚÌìΪ 0 </simpara> </listitem> <listitem> <simpara> %x - µ±Ç°ÇøÓòÊ×Ñ¡µÄʱ¼ä±íʾ·¨£¬²»°üÀ¨Ê±¼ä </simpara> </listitem> <listitem> <simpara> %X - µ±Ç°ÇøÓòÊ×Ñ¡µÄʱ¼ä±íʾ·¨£¬²»°üÀ¨ÈÕÆÚ </simpara> </listitem> <listitem> <simpara> %y - ûÓÐÊÀ¼ÍÊýµÄÊ®½øÖÆÄê·Ý£¨·¶Î§´Ó 00 µ½ 99£© </simpara> </listitem> <listitem> <simpara> %Y - °üÀ¨ÊÀ¼ÍÊýµÄÊ®½øÖÆÄê·Ý </simpara> </listitem> <listitem> <simpara> %Z - Ê±ÇøÃû»òËõд </simpara> </listitem> <listitem> <simpara> %% - ÎÄ×ÖÉ쵀 `%' ×Ö·û </simpara> </listitem> </itemizedlist> <note> <para> ¿ÉÄܲ»ÊÇËùÓеÄת»»±ê¼Ç¶¼±» C ¿âÎļþÖ§³Ö£¬ÕâÖÖÇé¿öÏ PHP µÄ <function>strftime</function> Ò²²»Ö§³Ö¡£ÕâÒâζ×ÅÀýÈç %e, %T ºÍ %D£¨¿ÉÄܸü¶à£©ÔÚ Windows ϲ»Æð×÷Óᣠ</para> </note> <example> <title><function>strftime</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ setlocale (LC_TIME, "C"); print (strftime ("%A in Finnish is ")); setlocale (LC_TIME, "fi_FI"); print (strftime ("%A, in French ")); setlocale (LC_TIME, "fr_FR"); print (strftime ("%A and in German ")); setlocale (LC_TIME, "de_DE"); print (strftime ("%A.\n")); ]]> </programlisting> </example> ±¾ÀýÔÚÄãµÄϵͳÖа²×°Óи÷×ÔµÄÇøÓòÉèÖúó²ÅÄܹ¤×÷¡£ </para> <para> ²Î¼û <function>setlocale</function> ºÍ <function>mktime</function> ÒÔ¼° <ulink url="&spec.strftime;">Open Group specification of <function>strftime</function></ulink>¡£ </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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/datetime/functions/strtotime.xml +++ phpdoc-zh/reference/datetime/functions/strtotime.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- splitted from ./en/functions/datetime.xml, last change in rev 1.8 --> <refentry id="function.strtotime"> <refnamediv> <refname>strtotime</refname> <refpurpose> ½«ÈκÎÓ¢ÎÄÎı¾µÄÈÕÆÚʱ¼äÃèÊö½âÎöΪ UNIX ʱ¼ä´Á </refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>int</type><methodname>strtotime</methodname> <methodparam><type>string</type><parameter>time</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>now</parameter></methodparam> </methodsynopsis> <simpara> ±¾º¯ÊýÔ¤ÆÚ½ÓÊÜÒ»¸ö°üº¬Ó¢ÎÄÈÕÆÚ¸ñʽµÄ×Ö·û´®²¢³¢ÊÔ½«Æä½âÎöΪ UNIX ʱ¼ä´Á¡£Èç¹û time µÄ¸ñʽÊǾø¶Ôʱ¼äÔò now ²ÎÊý²»Æð×÷Óá£Èç¹û time µÄ¸ñʽÊÇÏà¶Ôʱ¼äÔòÆäËùÏà¶ÔµÄʱ¼äÓÉ now Ìṩ£¬»òÕßÈç¹ûδÌṩ now ²ÎÊýʱÓõ±Ç°Ê±¼ä¡£Ê§°Üʱ·µ»Ø <literal>-1</literal>¡£ </simpara> <simpara> ÒòΪ <function>strtotime</function> µÄÐÐΪÊÇÒÀÕÕ GNU ÈÕÆÚÓï·¨µÄ£¬Òò´ËÇë¿´¿´ GNU ÊÖ²áÖÐµÄ <ulink url="&url.gnu.man.date-input;">Date Input Formats</ulink>¡£ÕâÀï¼ÇÊöÁË <parameter>time</parameter> ²ÎÊýµÄºÏ·¨Óï·¨¡£ </simpara> <para> <example> <title><function>strtotime</function> Àý×Ó</title> <programlisting role="php"> <![CDATA[ echo strtotime ("now"), "\n"; echo strtotime ("10 September 2000"), "\n"; echo strtotime ("+1 day"), "\n"; echo strtotime ("+1 week"), "\n"; echo strtotime ("+1 week 2 days 4 hours 2 seconds"), "\n"; echo strtotime ("next Thursday"), "\n"; echo strtotime ("last Monday"), "\n"; ]]> </programlisting> </example> </para> <para> <example> <title>¼ì²éʧ°Ü</title> <programlisting role="php"> <![CDATA[ $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> </para> <note> <para> ÓÐЧµÄʱ¼ä´ÁµäÐÍ·¶Î§ÊÇ´Ó¸ñÁÖÍþÖÎʱ¼ä 1901 Äê 12 Ô 13 ÈÕ ÐÇÆÚÎå 20:45:54 µ½ 2038Äê 1 Ô 19 ÈÕ ÐÇÆÚ¶þ 03:14:07¡££¨¸ÃÈÕÆÚ¸ù¾Ý 32 λÓзûºÅÕûÊýµÄ×îСֵºÍ×î´óÖµ¶øÀ´¡££© </para> </note> </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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> Index: phpdoc-zh/reference/datetime/functions/time.xml +++ phpdoc-zh/reference/datetime/functions/time.xml <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision: 1.1 $ --> <!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 --> <refentry id="function.time"> <refnamediv> <refname>time</refname> <refpurpose>·µ»Øµ±Ç°µÄ UNIX ʱ¼ä´Á</refpurpose> </refnamediv> <refsect1> <title>˵Ã÷</title> <methodsynopsis> <type>int</type><methodname>time</methodname> <void/> </methodsynopsis> <para> ·µ»Ø×Ô´Ó Unix мÍÔª£¨¸ñÁÖÍþÖÎʱ¼ä 1970 Äê 1 Ô 1 ÈÕ 00:00:00£©µ½µ±Ç°Ê±¼äµÄÃëÊý¡£ </para> <para> ²Î¼û <function>date</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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->