CVS update: php3/doc/functions
| From: | jaakko | Date: | Fri, 14 Aug 1998 07:35:14 +0000 |
| Subject: | CVS update: php3/doc/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-210@lists.php.net to get a copy of this message | ||
Date: Friday August 14, 1998 @ 3:35
Author: jaakko
Update of /repository/php3/doc/functions
In directory asf:/tmp/cvs-serv22009
Modified Files:
strings.sgml datetime.sgml
Log Message:
Document strftime(), please correct if I made mistakes with sgml syntax
Index: php3/doc/functions/strings.sgml
diff -c php3/doc/functions/strings.sgml:1.31 php3/doc/functions/strings.sgml:1.32
*** php3/doc/functions/strings.sgml:1.31 Wed Aug 5 01:18:39 1998
--- php3/doc/functions/strings.sgml Fri Aug 14 03:35:14 1998
***************
*** 586,598 ****
LC_COLLATE for string comparison - not currently implemented in PHP
</simpara></listitem><listitem><simpara>
LC_CTYPE for character classification and conversion, for
! example strtoupper()
</simpara></listitem><listitem><simpara>
LC_MONETARY for localeconv() - not currently implemented in PHP
</simpara></listitem><listitem><simpara>
LC_NUMERIC for decimal separator
</simpara></listitem><listitem><simpara>
! LC_TIME for time formats - not currently implemented in PHP
</simpara></listitem>
</itemizedlist>
--- 586,598 ----
LC_COLLATE for string comparison - not currently implemented in PHP
</simpara></listitem><listitem><simpara>
LC_CTYPE for character classification and conversion, for
! example <function>strtoupper</function>
</simpara></listitem><listitem><simpara>
LC_MONETARY for localeconv() - not currently implemented in PHP
</simpara></listitem><listitem><simpara>
LC_NUMERIC for decimal separator
</simpara></listitem><listitem><simpara>
! LC_TIME for date and time formatting with <function>strftime</function>
</simpara></listitem>
</itemizedlist>
Index: php3/doc/functions/datetime.sgml
diff -c php3/doc/functions/datetime.sgml:1.14 php3/doc/functions/datetime.sgml:1.15
*** php3/doc/functions/datetime.sgml:1.14 Sat Jul 25 16:49:07 1998
--- php3/doc/functions/datetime.sgml Fri Aug 14 03:35:14 1998
***************
*** 90,95 ****
--- 90,164 ----
</refentry>
+ <refentry id="function.strftime">
+ <refnamediv>
+ <refname>strftime</refname>
+ <refpurpose>format a local time/date according to locale settings</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>string <function>strftime</function></funcdef>
+ <paramdef>string <parameter>format</parameter></paramdef>
+ <paramdef>int <parameter>timestamp</parameter></paramdef>
+ </funcsynopsis>
+ <para>
+ Returns a string formatted according to the given format string
+ using the given <parameter>timestamp</parameter> or the current
+ local time if no timestamp is given. Month and weekday names
+ and other language dependent strings respect the current locale
+ set with <function>setlocale</function>.
+
+ <para>
+ The following conversion specifiers are recognized in the format string:
+ <itemizedlist>
+ <listitem><simpara>%a - abbreviated weekday name according to the current
locale</simpara></listitem>
+ <listitem><simpara>%A - full weekday name according to the current
locale</simpara></listitem>
+ <listitem><simpara>%b - abbreviated month name according to the current
locale</simpara></listitem>
+ <listitem><simpara>%B - full month name according to the current
locale</simpara></listitem>
+ <listitem><simpara>%c - preferred date and time representation for the current
locale</simpara></listitem>
+ <listitem><simpara>%d - day of the month as a decimal number (range 0 to
31)</simpara></listitem>
+ <listitem><simpara>%H - hour as a decimal number using a 24-hour clock (range 00
to 23)</simpara></listitem>
+ <listitem><simpara>%I - hour as a decimal number using a 12-hour clock (range 01
to 12)</simpara></listitem>
+ <listitem><simpara>%j - day of the year as a decimal number (range 001 to
366)</simpara></listitem>
+ <listitem><simpara>%m - month as a decimal number (range 10 to
12)</simpara></listitem>
+ <listitem><simpara>%M - minute as a decimal
number</simpara></listitem>
+ <listitem><simpara>%p - either
am' or pm' according to
the given time value, or the corresponding strings for the current
locale</simpara></listitem>
+ <listitem><simpara>%S - second as a decimal
number</simpara></listitem>
+ <listitem><simpara>%U - week number of the current year as a decimal number,
starting with the first Sunday as the first day of the first week</simpara></listitem>
+ <listitem><simpara>%W - week number of the current year as a decimal number,
starting with the first Monday as the first day of the first week</simpara></listitem>
+ <listitem><simpara>%w - day of the week as a decimal, Sunday being
0</simpara></listitem>
+ <listitem><simpara>%x - preferred date representation for the current locale
without the time</simpara></listitem>
+ <listitem><simpara>%X - preferred time representation for the current locale
without the date</simpara></listitem>
+ <listitem><simpara>%y - year as a decimal number without a century (range 00 to
99)</simpara></listitem>
+ <listitem><simpara>%Y - year as a decimal number including the
century</simpara></listitem>
+ <listitem><simpara>%Z - time zone or name or
abbreviation</simpara></listitem>
+ <listitem><simpara>%% - a literal `%'
character</simpara></listitem>
+ </itemizedlist>
+
+ <example>
+ <title><function>strftime</function> example</title>
+ <programlisting>
+ setlocale ("LC_TIME", "C");
+ print(strftime("%A in Finnish is "));
+ setlocale ("LC_TIME", "fi");
+ print(strftime("%A, in French "));
+ setlocale ("LC_TIME", "fr");
+ print(strftime("%A and in German "));
+ setlocale ("LC_TIME", "de");
+ print(strftime("%A.\n"));
+ </programlisting></example>
+ This example works if you have the respective locales installed
+ in your system.
+
+ <para>
+ See also <function>setlocale</function> and
+ <function>mktime</function>.
+ </para>
+ </refsect1>
+ </refentry>
+
+
<refentry id="function.getdate">
<refnamediv>
<refname>getdate</refname>
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net