cvs: phpdoc-zh /reference/datetime/functions strftime.xml

From: Date: Sun, 17 Aug 2003 06:41:54 +0000
Subject: cvs: phpdoc-zh /reference/datetime/functions strftime.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-1633@lists.php.net to get a copy of this message
dallas Sun Aug 17 02:41:54 2003 EDT Modified files: /phpdoc-zh/reference/datetime/functions strftime.xml Log: Updated. Index: phpdoc-zh/reference/datetime/functions/strftime.xml diff -u phpdoc-zh/reference/datetime/functions/strftime.xml:1.5 phpdoc-zh/reference/datetime/functions/strftime.xml:1.6 --- phpdoc-zh/reference/datetime/functions/strftime.xml:1.5 Sun Apr 20 02:22:53 2003 +++ phpdoc-zh/reference/datetime/functions/strftime.xml Sun Aug 17 02:41:54 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <!-- $Author: dallas $ --> -<!-- EN-Revision: 1.6 Maintainer: dallas Status: ready --> +<!-- EN-Revision: 1.9 Maintainer: dallas Status: ready --> <refentry id="function.strftime"> <refnamediv> <refname>strftime</refname> @@ -165,7 +165,7 @@ </simpara> </listitem> <listitem> - <simpara> + <simpara> %V - ±¾ÄêµÚ¼¸ÖÜµÄ ISO 8601:1988 ¸ñʽ£¬·¶Î§´Ó 01 µ½ 53£¬µÚ 1 ÖÜÊDZ¾ÄêµÚÒ»¸öÖÁÉÙ»¹ÓÐ 4 ÌìµÄÐÇÆÚ£¬ÐÇÆÚÒ»×÷ΪÿÖܵĵÚÒ»Ìì¡££¨Óà %G »òÕß %g ×÷Ϊָ¶¨Ê±¼ä´ÁÏàÓ¦ÖÜÊýµÄÄê·Ý×é³É¡££© @@ -215,8 +215,14 @@ <note> <para> ¿ÉÄܲ»ÊÇËùÓеÄת»»±ê¼Ç¶¼±» C ¿âÎļþÖ§³Ö£¬ÕâÖÖÇé¿öÏ PHP - µÄ <function>strftime</function> Ò²²»Ö§³Ö¡£ÕâÒâζ×ÅÀýÈç - %e, %T£¬%R ºÍ %D£¨¿ÉÄܸü¶à£©ÔÚ Windows ϲ»Æð×÷Óᣠ+ µÄ <function>strftime</function> + Ò²²»Ö§³Ö¡£´ËÍ⣬²»ÊÇËùÓÐµÄÆ½Ì¨¶¼Ö§³Ö¸ºµÄʱ¼ä´Á£¬Òò´ËÈÕÆÚµÄ·¶Î§¿ÉÄÜÏÞ¶¨ÔÚ²»ÔçÓÚ + Unix ¼ÍÔª¡£ÕâÒâζ×ÅÀýÈç + %e, %T£¬%R ºÍ %D£¨¿ÉÄܸü¶à£©ÒÔ¼°ÔçÓÚ + <literal>Jan 1, 1970</literal> µÄʱ¼äÔÚ Windows£¬Ò»Ð© Linux + ·¢Ðа汾£¬ÒÔ¼°ÆäËü¼¸¸ö²Ù×÷ϵͳÖÐÎÞЧ¡£¶ÔÓÚ Windows + ϵͳ£¬ËùÖ§³ÖµÄת»»±ê¼Ç¿ÉÔÚ + <ulink url="&url.strftime.win32;"><acronym>MSDN</acronym> ÍøÕ¾</ulink>ÕÒµ½¡£ </para> </note> <example> @@ -237,65 +243,65 @@ </programlisting> </example> ±¾ÀýÔÚÄãµÄϵͳÖа²×°Óи÷×ÔµÄÇøÓòÉèÖúó²ÅÄܹ¤×÷¡£ - <note> - <simpara> + <note> + <simpara> %G ºÍ %V£¬Èç¹ûÊý×Ö±àºÅϵͳδÄܳä·ÖÀí½â£¬»ùÓÚ ISO 8601:1988 µÄÐÇÆÚÊý¿ÉÄܵóöδԤÆÚµÄ½á¹û¡£¼ûÉÏÃæµÄ %V ºÍÒÔϵÄÀý×Ó¡£ - </simpara> - </note> - <example> - <title>ISO 8601:1988 week number example</title> - <programlisting role="php"> -<![CDATA[ -<?php -/* December 2002 / January 2003 -ISOWk M Tu W Thu F Sa Su ------ ---------------------------- -51 16 17 18 19 20 21 22 -52 23 24 25 26 27 28 29 -1 30 31 1 2 3 4 5 -2 6 7 8 9 10 11 12 -3 13 14 15 16 17 18 19 */ - -// Outputs: 12/28/2002 - %V,%G,%Y = 52,2002,2002 -print "12/28/2002 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("12/28/2002")) . "\n"; - -// Outputs: 12/30/2002 - %V,%G,%Y = 1,2003,2002 -print "12/30/2002 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("12/30/2002")) . "\n"; - -// Outputs: 1/3/2003 - %V,%G,%Y = 1,2003,2003 -print "1/3/2003 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/3/2003")) . "\n"; - -// Outputs: 1/10/2003 - %V,%G,%Y = 2,2003,2003 -print "1/10/2003 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/10/2003")) . "\n"; - - - -/* December 2004 / January 2005 -ISOWk M Tu W Thu F Sa Su ------ ---------------------------- -51 13 14 15 16 17 18 19 -52 20 21 22 23 24 25 26 -53 27 28 29 30 31 1 2 -1 3 4 5 6 7 8 9 -2 10 11 12 13 14 15 16 */ - -// Outputs: 12/23/2004 - %V,%G,%Y = 52,2004,2004 -print "12/23/2004 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("12/23/2004")) . "\n"; - -// Outputs: 12/31/2004 - %V,%G,%Y = 53,2004,2004 -print "12/31/2004 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("12/31/2004")) . "\n"; - -// Outputs: 1/2/2005 - %V,%G,%Y = 53,2004,2005 -print "1/2/2005 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/2/2005")) . "\n"; - -// Outputs: 1/3/2005 - %V,%G,%Y = 1,2005,2005 -print "1/3/2005 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/3/2005")) . "\n"; - -?> -]]> - </programlisting> - </example> + </simpara> + </note> + <example> + <title>ISO 8601:1988 week number example</title> + <programlisting role="php"> +<![CDATA[ +<?php +/* December 2002 / January 2003 +ISOWk M Tu W Thu F Sa Su +----- ---------------------------- +51 16 17 18 19 20 21 22 +52 23 24 25 26 27 28 29 +1 30 31 1 2 3 4 5 +2 6 7 8 9 10 11 12 +3 13 14 15 16 17 18 19 */ + +// Outputs: 12/28/2002 - %V,%G,%Y = 52,2002,2002 +print "12/28/2002 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("12/28/2002")) . "\n"; + +// Outputs: 12/30/2002 - %V,%G,%Y = 1,2003,2002 +print "12/30/2002 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("12/30/2002")) . "\n"; + +// Outputs: 1/3/2003 - %V,%G,%Y = 1,2003,2003 +print "1/3/2003 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/3/2003")) . "\n"; + +// Outputs: 1/10/2003 - %V,%G,%Y = 2,2003,2003 +print "1/10/2003 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/10/2003")) . "\n"; + + + +/* December 2004 / January 2005 +ISOWk M Tu W Thu F Sa Su +----- ---------------------------- +51 13 14 15 16 17 18 19 +52 20 21 22 23 24 25 26 +53 27 28 29 30 31 1 2 +1 3 4 5 6 7 8 9 +2 10 11 12 13 14 15 16 */ + +// Outputs: 12/23/2004 - %V,%G,%Y = 52,2004,2004 +print "12/23/2004 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("12/23/2004")) . "\n"; + +// Outputs: 12/31/2004 - %V,%G,%Y = 53,2004,2004 +print "12/31/2004 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("12/31/2004")) . "\n"; + +// Outputs: 1/2/2005 - %V,%G,%Y = 53,2004,2005 +print "1/2/2005 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/2/2005")) . "\n"; + +// Outputs: 1/3/2005 - %V,%G,%Y = 1,2005,2005 +print "1/3/2005 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/3/2005")) . "\n"; + +?> +]]> + </programlisting> + </example> </para> <para> ²Î¼û <function>setlocale</function> ºÍ <function>mktime</function>

« previous php.doc.zh (#1633) next »