Only formatting, content hasn't changed.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@20803 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Egon Schmid 2000-03-01 20:38:59 +00:00
parent 3c0cba0659
commit eeab6fe60e

View file

@ -5,7 +5,7 @@
<refentry id="function.checkdate">
<refnamediv>
<refname>checkdate</refname>
<refpurpose>validate a date/time</refpurpose>
<refpurpose>Validate a date/time</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -17,29 +17,34 @@
</funcsynopsis>
<para>
Returns true if the date given is valid; otherwise returns false.
Checks the validity of the date formed by the arguments. A date is
considered valid if:
Checks the validity of the date formed by the arguments. A date
is considered valid if:
<itemizedlist>
<listitem><simpara>
<listitem>
<simpara>
year is between 0 and 32767 inclusive
</simpara></listitem>
<listitem><simpara>
</simpara>
</listitem>
<listitem>
<simpara>
month is between 1 and 12 inclusive
</simpara></listitem>
<listitem><simpara>
</simpara>
</listitem>
<listitem>
<simpara>
day is within the allowed number of days for the given month.
Leap years are taken into consideration.
</simpara></listitem>
</simpara>
</listitem>
</itemizedlist>
</para>
</refsect1>
</refentry>
<refentry id="function.date">
<refnamediv>
<refname>date</refname>
<refpurpose>format a local time/date</refpurpose>
<refpurpose>Format a local time/date</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -55,70 +60,175 @@
<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.</para>
local time if no timestamp is given.
</para>
<para>
The following characters are recognized in the format string:
<itemizedlist>
<listitem><simpara>a - "am" or "pm"</simpara></listitem>
<listitem><simpara>A - "AM" or "PM"</simpara></listitem>
<listitem><simpara>d - day of the month, 2 digits with leading zeros; i.e. "01" to "31"</simpara></listitem>
<listitem><simpara>D - day of the week, textual, 3 letters; i.e. "Fri"</simpara></listitem>
<listitem><simpara>F - month, textual, long; i.e. "January"</simpara></listitem>
<listitem><simpara>h - hour, 12-hour format; i.e. "01" to "12"</simpara></listitem>
<listitem><simpara>H - hour, 24-hour format; i.e. "00" to "23"</simpara></listitem>
<listitem><simpara>g - hour, 12-hour format without leading zeros; i.e. "1" to "12"</simpara></listitem>
<listitem><simpara>G - hour, 24-hour format without leading zeros; i.e. "0" to "23"</simpara></listitem>
<listitem><simpara>i - minutes; i.e. "00" to "59"</simpara></listitem>
<listitem><simpara>j - day of the month without leading zeros; i.e. "1" to "31"</simpara></listitem>
<listitem><simpara>l (lowercase 'L') - day of the week, textual, long; i.e. "Friday"</simpara></listitem>
<listitem><simpara>L - boolean for whether it is a leap year; i.e. "0" or "1"</simpara></listitem>
<listitem><simpara>m - month; i.e. "01" to "12"</simpara></listitem>
<listitem><simpara>n - month without leading zeros; i.e. "1" to "12"</simpara></listitem>
<listitem><simpara>M - month, textual, 3 letters; i.e. "Jan"</simpara></listitem>
<listitem><simpara>s - seconds; i.e. "00" to "59"</simpara></listitem>
<listitem><simpara>S - English ordinal suffix, textual, 2 characters; i.e. "th", "nd"</simpara></listitem>
<listitem><simpara>t - number of days in the given month; i.e. "28" to "31"</simpara></listitem>
<listitem><simpara>U - seconds since the epoch</simpara></listitem>
<listitem><simpara>w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)</simpara></listitem>
<listitem><simpara>Y - year, 4 digits; i.e. "1999"</simpara></listitem>
<listitem><simpara>y - year, 2 digits; i.e. "99"</simpara></listitem>
<listitem><simpara>z - day of the year; i.e. "0" to "365"</simpara></listitem>
<listitem><simpara>Z - timezone offset in seconds (i.e. "-43200" to "43200")</simpara></listitem>
<listitem>
<simpara>
a - "am" or "pm"
</simpara>
</listitem>
<listitem>
<simpara>
A - "AM" or "PM"
</simpara>
</listitem>
<listitem>
<simpara>
d - day of the month, 2 digits with leading zeros; i.e. "01"
to "31"
</simpara>
</listitem>
<listitem>
<simpara>
D - day of the week, textual, 3 letters; i.e. "Fri"
</simpara>
</listitem>
<listitem>
<simpara>
F - month, textual, long; i.e. "January"
</simpara>
</listitem>
<listitem>
<simpara>
h - hour, 12-hour format; i.e. "01" to "12"
</simpara>
</listitem>
<listitem>
<simpara>
H - hour, 24-hour format; i.e. "00" to "23"
</simpara>
</listitem>
<listitem>
<simpara>
g - hour, 12-hour format without leading zeros; i.e. "1" to
"12"
</simpara>
</listitem>
<listitem>
<simpara>
G - hour, 24-hour format without leading zeros; i.e. "0" to
"23"
</simpara>
</listitem>
<listitem>
<simpara>
i - minutes; i.e. "00" to "59"
</simpara>
</listitem>
<listitem>
<simpara>
j - day of the month without leading zeros; i.e. "1" to "31"
</simpara>
</listitem>
<listitem>
<simpara>
l (lowercase 'L') - day of the week, textual, long;
i.e. "Friday"
</simpara>
</listitem>
<listitem>
<simpara>
L - boolean for whether it is a leap year; i.e. "0" or "1"
</simpara>
</listitem>
<listitem>
<simpara>
m - month; i.e. "01" to "12"
</simpara>
</listitem>
<listitem>
<simpara>
n - month without leading zeros; i.e. "1" to "12"
</simpara>
</listitem>
<listitem>
<simpara>
M - month, textual, 3 letters; i.e. "Jan"
</simpara>
</listitem>
<listitem>
<simpara>
s - seconds; i.e. "00" to "59"
</simpara>
</listitem>
<listitem>
<simpara>
S - English ordinal suffix, textual, 2 characters; i.e. "th",
"nd"
</simpara>
</listitem>
<listitem>
<simpara>
t - number of days in the given month; i.e. "28" to "31"
</simpara>
</listitem>
<listitem>
<simpara>
U - seconds since the epoch
</simpara>
</listitem>
<listitem>
<simpara>
w - day of the week, numeric, i.e. "0" (Sunday) to "6"
(Saturday)
</simpara>
</listitem>
<listitem>
<simpara>
Y - year, 4 digits; i.e. "1999"
</simpara>
</listitem>
<listitem>
<simpara>
y - year, 2 digits; i.e. "99"
</simpara>
</listitem>
<listitem>
<simpara>
z - day of the year; i.e. "0" to "365"
</simpara>
</listitem>
<listitem>
<simpara>
Z - timezone offset in seconds (i.e. "-43200" to "43200")
</simpara>
</listitem>
</itemizedlist>
Unrecognized characters in the format string will be printed as-is.
The "Z" format will always return "0" when using <function>gmdate()</function>.
Unrecognized characters in the format string will be printed
as-is. The "Z" format will always return "0" when using
<function>gmdate</function>.
<example>
<title><function>date</function> example</title>
<title><function>Date</function> example</title>
<programlisting role="php">
print (date("l dS of F Y h:i:s A"));
print ("July 1, 2000 is on a " . date("l", mktime(0,0,0,7,1,2000)));
print (date ("l dS of F Y h:i:s A"));
print ("July 1, 2000 is on a " . date ("l", mktime(0,0,0,7,1,2000)));
</programlisting>
</example></para>
</example>
</para>
<para>
It is possible to use <function>date</function> and
<function>mktime</function> together to find dates in the future
or the past.
<example>
<title>
<function>date</function> and <function>mktime</function> example
<function>Date</function> and <function>mktime</function>
example
</title>
<programlisting>
$tomorrow = mktime(0,0,0,date("m") ,date("d")+1,date("Y"));
$lastmonth = mktime(0,0,0,date("m")-1,date("d"), date("Y"));
$nextyear = mktime(0,0,0,date("m"), date("d"), date("Y")+1);
$tomorrow = mktime (0,0,0,date("m") ,date("d")+1,date("Y"));
$lastmonth = mktime (0,0,0,date("m")-1,date("d"), date("Y"));
$nextyear = mktime (0,0,0,date("m"), date("d"), date("Y")+1);
</programlisting>
</example>
</para>
<para>
To format dates in other languages, you should use the
<function>setlocale</function> and <function>strftime</function>
functions.
</para>
<para>
See also <function>gmdate</function> and
<function>mktime</function>.
@ -126,11 +236,10 @@ $nextyear = mktime(0,0,0,date("m"), date("d"), date("Y")+1);
</refsect1>
</refentry>
<refentry id="function.getdate">
<refnamediv>
<refname>getdate</refname>
<refpurpose>get date/time information</refpurpose>
<refpurpose>Get date/time information</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -139,20 +248,59 @@ $nextyear = mktime(0,0,0,date("m"), date("d"), date("Y")+1);
<paramdef>int <parameter>timestamp</parameter></paramdef>
</funcsynopsis>
<para>
Returns an associative array containing the date information of the
timestamp as the following array elements:
Returns an associative array containing the date information of
the timestamp as the following array elements:
<itemizedlist>
<listitem><simpara>"seconds" - seconds</simpara></listitem>
<listitem><simpara>"minutes" - minutes</simpara></listitem>
<listitem><simpara>"hours" - hours</simpara></listitem>
<listitem><simpara>"mday" - day of the month</simpara></listitem>
<listitem><simpara>"wday" - day of the week, numeric</simpara></listitem>
<listitem><simpara>"mon" - month, numeric</simpara></listitem>
<listitem><simpara>"year" - year, numeric</simpara></listitem>
<listitem><simpara>"yday" - day of the year, numeric; i.e. "299"</simpara></listitem>
<listitem><simpara>"weekday" - day of the week, textual, full; i.e.
"Friday"</simpara></listitem>
<listitem><simpara>"month" - month, textual, full; i.e. "January"</simpara></listitem>
<listitem>
<simpara>
"seconds" - seconds
</simpara>
</listitem>
<listitem>
<simpara>
"minutes" - minutes
</simpara>
</listitem>
<listitem>
<simpara>
"hours" - hours
</simpara>
</listitem>
<listitem>
<simpara>
"mday" - day of the month
</simpara>
</listitem>
<listitem>
<simpara>
"wday" - day of the week, numeric
</simpara>
</listitem>
<listitem>
<simpara>
"mon" - month, numeric
</simpara>
</listitem>
<listitem>
<simpara>
"year" - year, numeric
</simpara>
</listitem>
<listitem>
<simpara>
"yday" - day of the year, numeric; i.e. "299"
</simpara>
</listitem>
<listitem>
<simpara>
"weekday" - day of the week, textual, full; i.e. "Friday"
</simpara>
</listitem>
<listitem>
<simpara>
"month" - month, textual, full; i.e. "January"
</simpara>
</listitem>
</itemizedlist>
</para>
</refsect1>
@ -161,7 +309,7 @@ $nextyear = mktime(0,0,0,date("m"), date("d"), date("Y")+1);
<refentry id="function.gettimeofday">
<refnamediv>
<refname>gettimeofday</refname>
<refpurpose>get current time</refpurpose>
<refpurpose>Get current time</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -171,13 +319,29 @@ $nextyear = mktime(0,0,0,date("m"), date("d"), date("Y")+1);
</funcsynopsis>
<para>
This is an interface to gettimeofday(2). It returns an
associative array containing the data returned from the
system call.
associative array containing the data returned from the system
call.
<itemizedlist>
<listitem><simpara>"sec" - seconds</simpara></listitem>
<listitem><simpara>"usec" - microseconds</simpara></listitem>
<listitem><simpara>"minuteswest" - minutes west of Greenwich</simpara></listitem>
<listitem><simpara>"dsttime" - type of dst correction</simpara></listitem>
<listitem>
<simpara>
"sec" - seconds
</simpara>
</listitem>
<listitem>
<simpara>
"usec" - microseconds
</simpara>
</listitem>
<listitem>
<simpara>
"minuteswest" - minutes west of Greenwich
</simpara>
</listitem>
<listitem>
<simpara>
"dsttime" - type of dst correction
</simpara>
</listitem>
</itemizedlist>
</para>
</refsect1>
@ -186,7 +350,7 @@ $nextyear = mktime(0,0,0,date("m"), date("d"), date("Y")+1);
<refentry id="function.gmdate">
<refnamediv>
<refname>gmdate</refname>
<refpurpose>format a GMT/CUT date/time</refpurpose>
<refpurpose>Gormat a GMT/CUT date/time</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -196,31 +360,29 @@ $nextyear = mktime(0,0,0,date("m"), date("d"), date("Y")+1);
<paramdef>int <parameter>timestamp</parameter></paramdef>
</funcsynopsis>
<para>
Identical to the <function>date</function>
function except that the time returned is Greenwich Mean Time
(GMT). For example, when run in Finland (GMT +0200), the first
line below prints "Jan 01 1998 00:00:00", while the second prints
"Dec 31 1997 22:00:00".
Identical to the <function>date</function> function except that
the time returned is Greenwich Mean Time (GMT). For example, when
run in Finland (GMT +0200), the first line below prints "Jan 01
1998 00:00:00", while the second prints "Dec 31 1997 22:00:00".
<example>
<title><function>gmdate</function> example</title>
<title><function>Gmdate</function> example</title>
<programlisting role="php">
echo date( "M d Y H:i:s",mktime(0,0,0,1,1,1998) );
echo gmdate( "M d Y H:i:s",mktime(0,0,0,1,1,1998) );
echo date ("M d Y H:i:s", mktime (0,0,0,1,1,1998));
echo gmdate ("M d Y H:i:s", mktime (0,0,0,1,1,1998));
</programlisting>
</example>
</para>
<para>
See also <function>date</function>,
<function>mktime</function> and <function>gmmktime</function>.
See also <function>date</function>, <function>mktime</function>,
and <function>gmmktime</function>.
</para>
</refsect1>
</refentry>
<refentry id="function.gmmktime">
<refnamediv>
<refname>gmmktime</refname>
<refpurpose>get UNIX timestamp for a GMT date</refpurpose>
<refpurpose>Get UNIX timestamp for a GMT date</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -232,11 +394,13 @@ echo gmdate( "M d Y H:i:s",mktime(0,0,0,1,1,1998) );
<paramdef>int <parameter>month</parameter></paramdef>
<paramdef>int <parameter>day</parameter></paramdef>
<paramdef>int <parameter>year</parameter></paramdef>
<paramdef>int <parameter><optional>is_dst</optional></parameter></paramdef>
<paramdef>int
<parameter><optional>is_dst</optional></parameter>
</paramdef>
</funcsynopsis>
<para>
Identical to <function>mktime</function> except the passed parameters
represents a GMT date.
Identical to <function>mktime</function> except the passed
parameters represents a GMT date.
</para>
</refsect1>
</refentry>
@ -244,7 +408,9 @@ echo gmdate( "M d Y H:i:s",mktime(0,0,0,1,1,1998) );
<refentry id="function.gmstrftime">
<refnamediv>
<refname>gmstrftime</refname>
<refpurpose>format a GMT/CUT time/date according to locale settings</refpurpose>
<refpurpose>
Format a GMT/CUT time/date according to locale settings
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -257,13 +423,14 @@ echo gmdate( "M d Y H:i:s",mktime(0,0,0,1,1,1998) );
Behaves the same as <function>strftime</function> except that the
time returned is Greenwich Mean Time (GMT). For example, when run
in Eastern Standard Time (GMT -0500), the first line below prints
"Dec 31 1998 20:00:00", while the second prints "Jan 01 1999 01:00:00".
"Dec 31 1998 20:00:00", while the second prints "Jan 01 1999
01:00:00".
<example>
<title><function>gmstrftime</function> example</title>
<title><function>Gmstrftime</function> example</title>
<programlisting role="php">
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";
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>
@ -276,7 +443,8 @@ echo gmstrftime ("%b %d %Y %H:%M:%S",mktime(20,0,0,12,31,98))."\n";
<refentry id="function.microtime">
<refnamediv>
<refname>microtime</refname>
<refpurpose>return current UNIX timestamp with microseconds</refpurpose>
<refpurpose>
Return current UNIX timestamp with microseconds</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -300,7 +468,7 @@ echo gmstrftime ("%b %d %Y %H:%M:%S",mktime(20,0,0,12,31,98))."\n";
<refentry id="function.mktime">
<refnamediv>
<refname>mktime</refname>
<refpurpose>get UNIX timestamp for a date</refpurpose>
<refpurpose>Get UNIX timestamp for a date</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -312,52 +480,58 @@ echo gmstrftime ("%b %d %Y %H:%M:%S",mktime(20,0,0,12,31,98))."\n";
<paramdef>int <parameter>month</parameter></paramdef>
<paramdef>int <parameter>day</parameter></paramdef>
<paramdef>int <parameter>year</parameter></paramdef>
<paramdef>int <parameter><optional>is_dst</optional></parameter></paramdef>
<paramdef>int
<parameter><optional>is_dst</optional></parameter>
</paramdef>
</funcsynopsis>
<para>
<emphasis>Warning:</emphasis> 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>
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>
Returns the Unix timestamp corresponding to the arguments
given. This timestamp is a long integer containing the number of
seconds between the Unix Epoch (January 1 1970) and the time
specified.
</para><para>
</para>
<para>
Arguments may be left out in order from right to left; any
arguments thus omitted will be set to the current value according
to the local date and time.
</para><para>
<parameter>is_dst</parameter> can be set to 1 if the time
is during daylight savings time, 0 if it is not, or -1 (the
default) if it is unknown whether the time is within daylight
savings time or not.
</para>
<para>
<parameter>is_dst</parameter> can be set to 1 if the time is
during daylight savings time, 0 if it is not, or -1 (the default)
if it is unknown whether the time is within daylight savings time
or not.
</para>
<note>
<para><parameter>is_dst</parameter> was added in 3.0.10.</para>
<para>
<parameter>is_dst</parameter> was added in 3.0.10.
</para>
</note>
<para>
<function>mktime</function> is useful for doing date arithmetic and
validation, as it will automatically calculate the correct value
for out-of-range input. For example, each of the following lines
produces the string "Jan-01-1998".
<function>Mktime</function> is useful for doing date arithmetic
and validation, as it will automatically calculate the correct
value for out-of-range input. For example, each of the following
lines produces the string "Jan-01-1998".
<example>
<title><function>mktime</function> example</title>
<title><function>Mktime</function> example</title>
<programlisting>
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) );
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> may be a two or four digit value, with
values between 0-69 mapping to 2000-2069 and 70-99 to 1970-1999
(on systems where time_t is a 32bit signed integer, as most common
today, the valid range for <parameter>year</parameter> is somewhere
between 1902 and 2037).
<parameter>year</parameter> may be a two or four digit value,
with values between 0-69 mapping to 2000-2069 and 70-99 to
1970-1999 (on systems where time_t is a 32bit signed integer, as
most common today, the valid range for
<parameter>year</parameter> is somewhere between 1902 and 2037).
</para>
<para>
The last day of any given month can be expressed as the "0" day
@ -365,12 +539,12 @@ echo date( "M-d-Y", mktime(0,0,0,1,1,98) );
will produce the string "The last day in Feb 2000 is: 29".
<example>
<title>Last day of next month</title>
<programlisting>
$lastday=mktime(0,0,0,3,0,2000);
echo strftime("Last day in Feb 2000 is: %d",$lastday);
<programlisting role="php">
$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);
$lastday = mktime (0,0,0,4,-31,2000);
echo strftime ("Last day in Feb 2000 is: %d", $lastday);
</programlisting>
</example>
</para>
@ -396,53 +570,152 @@ echo strftime("Last day in Feb 2000 is: %d",$lastday);
<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>
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>
<para>
The following conversion specifiers are recognized in the format string:
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 00 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 1 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>
<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 00 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 1 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>
<title><function>Strftime</function> example</title>
<programlisting role="php">
setlocale ("LC_TIME", "C");
print(strftime("%A in Finnish is "));
print (strftime ("%A in Finnish is "));
setlocale ("LC_TIME", "fi_FI");
print(strftime("%A, in French "));
print (strftime ("%A, in French "));
setlocale ("LC_TIME", "fr_CA");
print(strftime("%A and in German "));
print (strftime ("%A and in German "));
setlocale ("LC_TIME", "de_DE");
print(strftime("%A.\n"));
print (strftime ("%A.\n"));
</programlisting>
</example>
This example works if you have the respective locales installed
in your system.</para>
in your system.
</para>
<para>
See also <function>setlocale</function> and
<function>mktime</function>.
@ -453,7 +726,7 @@ print(strftime("%A.\n"));
<refentry id="function.time">
<refnamediv>
<refname>time</refname>
<refpurpose>return current UNIX timestamp</refpurpose>
<refpurpose>Return current UNIX timestamp</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@ -464,7 +737,8 @@ print(strftime("%A.\n"));
<para>
Returns the current time measured in the number of seconds since
the Unix Epoch (January 1 1970 00:00:00 GMT).
</para><para>
</para>
<para>
See also <function>date</function>.
</para>
</refsect1>