cvs: phpdoc-hu /reference/datetime/functions strftime.xml
| From: | Bagi Levente L�szl� | Date: | Thu, 05 Aug 2004 20:13:17 +0000 |
| Subject: | cvs: phpdoc-hu /reference/datetime/functions strftime.xml | ||
| Groups: | php.doc.hu | ||
| Request: | Send a blank email to doc-hu+get-884@lists.php.net to get a copy of this message | ||
bagilevi Thu Aug 5 16:13:17 2004 EDT
Modified files:
/phpdoc-hu/reference/datetime/functions strftime.xml
Log:
sync
http://cvs.php.net/diff.php/phpdoc-hu/reference/datetime/functions/strftime.xml?r1=1.2&r2=1.3&ty=u
Index: phpdoc-hu/reference/datetime/functions/strftime.xml
diff -u phpdoc-hu/reference/datetime/functions/strftime.xml:1.2
phpdoc-hu/reference/datetime/functions/strftime.xml:1.3
--- phpdoc-hu/reference/datetime/functions/strftime.xml:1.2 Wed Apr 17 02:57:56 2002
+++ phpdoc-hu/reference/datetime/functions/strftime.xml Thu Aug 5 16:13:17 2004
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- splitted from ./hu/functions/datetime.xml, last change in rev 1.1 -->
<!-- last change to 'strftime' in en/ tree in rev 1.2 -->
-<!-- EN-Revision: 1.2 Maintainer: kgergely Status: ready -->
+<!-- EN-Revision: 1.13 Maintainer: kgergely Status: ready -->
<!-- OLD-Revision: 1.69/EN.1.2 -->
<refentry id="function.strftime">
<refnamediv>
@@ -225,25 +225,102 @@
<para>
Nem minden formátumstring van meg az összes C könyvtárban, ami azt
jelenti, hogy a PHP <function>strftime</function> függvényében sem
- lesznek elérhetõk.
+ lesznek elérhetõk. Ráadásul nem minden platform támogatja a negatív
+ idõbélyegeket, ezért a elõfordulhat, hogy nem használhatsz Unix
+ Epoch elõtti dátumot. Ez azt jelenti, hogy például a %e, %T, %R és a
+ %D (esetleg egyebek is) nem fog mûködni <literal>1970.
+ január 1./literal> elõtti dátummal Windows-on, néhány Linux
+ disztribûcióban, és még néhány egyéb operációs rendszeren.
+ A Windows rendszerekre vonatkozóan a a támogatott konverzió
+ leírókról található egy teljes áttekintés az
+ <ulink url="&url.strftime.win32;"><acronym>MSDN</acronym>
+ weboldalon</ulink>.
</para>
</note>
<example>
<title><function>strftime</function> példa</title>
<programlisting role="php">
<![CDATA[
-setlocale (LC_TIME, "C");
-print (strftime ("A finnül "));
-setlocale (LC_TIME", "fi_FI");
-print (strftime ("%A, franciául "));
-setlocale (LC_TIME, "fr_FR");
-print (strftime ("%A és magyarul "));
-setlocale (LC_TIME, "hu_HU");
-print (strftime ("%A.\n"));
+<?php
+setlocale(LC_TIME, "C");
+echo strftime("%A");
+setlocale(LC_TIME, "fi_FI");
+echo strftime(" finnül %A,");
+setlocale(LC_TIME, "fr_FR");
+echo strftime(" franciául %A és ");
+setlocale(LC_TIME, "hu_HU");
+echo strftime(" magyarul %A\n");
+?>
+]]>
+ </programlisting>
+ </example>
+ Ez a példa akkor mûködik jól, ha a megfelelõ locales beállításokat
+ installálod.
+ <note>
+ <simpara>
+ A %G és %V, amelyek az ISO 8601:1988 hétszámokra alapulnak, nem
+ az elvárt (de a helyes) eredményt adják, ha nem értetted meg
+ alaposan a számozási rendszert. Lásd a fenti %V-t valamint az
+ alábbi példát
+
+ week numbers can
+ give unexpected (albeit correct) results if the numbering system
+ is not thoroughly understood. See %V above and example below.
+ </simpara>
+ </note>
+ <example>
+ <title>ISO 8601:1988 hétszámozási példa</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 */
+
+// Kimenet: 12/28/2002 - %V,%G,%Y = 52,2002,2002
+echo "12/28/2002 - %V,%G,%Y = " . strftime("%V,%G,%Y",
strtotime("12/28/2002")) . "\n";
+
+// Kimenet: 12/30/2002 - %V,%G,%Y = 1,2003,2002
+echo "12/30/2002 - %V,%G,%Y = " . strftime("%V,%G,%Y",
strtotime("12/30/2002")) . "\n";
+
+// Kimenet: 1/3/2003 - %V,%G,%Y = 1,2003,2003
+echo "1/3/2003 - %V,%G,%Y = " . strftime("%V,%G,%Y",
strtotime("1/3/2003")) . "\n";
+
+// Kimenet: 1/10/2003 - %V,%G,%Y = 2,2003,2003
+echo "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 */
+
+// Kimenet: 12/23/2004 - %V,%G,%Y = 52,2004,2004
+echo "12/23/2004 - %V,%G,%Y = " .
strftime("%V,%G,%Y",strtotime("12/23/2004")) . "\n";
+
+// Kimenet: 12/31/2004 - %V,%G,%Y = 53,2004,2004
+echo "12/31/2004 - %V,%G,%Y = " .
strftime("%V,%G,%Y",strtotime("12/31/2004")) . "\n";
+
+// Kimenet: 1/2/2005 - %V,%G,%Y = 53,2004,2005
+echo "1/2/2005 - %V,%G,%Y = " . strftime("%V,%G,%Y",
strtotime("1/2/2005")) . "\n";
+
+// Kimenet: 1/3/2005 - %V,%G,%Y = 1,2005,2005
+echo "1/3/2005 - %V,%G,%Y = " . strftime("%V,%G,%Y",
strtotime("1/3/2005")) . "\n";
+
+?>
]]>
</programlisting>
</example>
- Ez a példa akkor mûködik jól, ha a megfelelõ locales beállításokat installálod.
</para>
<para>
Lásd még <function>setlocale</function> és