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

From: Date: Sun, 12 Jan 2003 11:01:02 +0000
Subject: cvs: phpdoc-zh /reference/datetime/functions strftime.xml
Groups: php.doc.zh 
Request: Send a blank email to doc-zh+get-974@lists.php.net to get a copy of this message
dallas Sun Jan 12 06:01:02 2003 EDT Modified files: /phpdoc-zh/reference/datetime/functions strftime.xml Log: Up to dated. Index: phpdoc-zh/reference/datetime/functions/strftime.xml diff -u phpdoc-zh/reference/datetime/functions/strftime.xml:1.3 phpdoc-zh/reference/datetime/functions/strftime.xml:1.4 --- phpdoc-zh/reference/datetime/functions/strftime.xml:1.3 Mon Dec 16 04:25:06 2002 +++ phpdoc-zh/reference/datetime/functions/strftime.xml Sun Jan 12 06:01:01 2003 @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="gb2312"?> -<!-- $Revision: 1.3 $ --> -<!-- $Author: yincheng $ --> -<!-- EN-Revision: 1.4 Maintainer: dallas Status: ready --> +<!-- $Revision: 1.4 $ --> +<!-- $Author: dallas $ --> +<!-- EN-Revision: 1.5 Maintainer: dallas Status: ready --> <refentry id="function.strftime"> <refnamediv> <refname>strftime</refname> @@ -220,7 +220,7 @@ </para> </note> <example> - <title><function>strftime</function> Àý×Ó</title> + <title><function>strftime</function> ÇøÓòµÄÀý×Ó</title> <programlisting role="php"> <![CDATA[ setlocale (LC_TIME, "C"); @@ -235,6 +235,65 @@ </programlisting> </example> ±¾ÀýÔÚÄãµÄϵͳÖа²×°Óи÷×ÔµÄÇøÓòÉèÖúó²ÅÄܹ¤×÷¡£ + <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> </para> <para> ²Î¼û <function>setlocale</function> ºÍ <function>mktime</function>

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