mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 08:58:56 +00:00
Converted ext.datetime to the new doc style. Some minor content changes were required.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@216120 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
3bf269d88b
commit
f9cc1ed20c
14 changed files with 1502 additions and 890 deletions
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<refentry id="function.checkdate">
|
||||
<refnamediv>
|
||||
<refname>checkdate</refname>
|
||||
<refpurpose>Validate a Gregorian date</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>checkdate</methodname>
|
||||
<methodparam><type>int</type><parameter>month</parameter></methodparam>
|
||||
|
@ -15,29 +15,54 @@
|
|||
<methodparam><type>int</type><parameter>year</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<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:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
year is between 1 and 32767 inclusive
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
month is between 1 and 12 inclusive
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
<parameter>Day</parameter> is within the allowed number of
|
||||
days for the given <parameter>month</parameter>. Leap
|
||||
<parameter>year</parameter>s are taken into consideration.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
is considered valid if each parameter is properly defined.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>month</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The month is between 1 and 12 inclusive.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>day</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The day is within the allowed number of days for the given
|
||||
<parameter>month</parameter>. Leap <parameter>year</parameter>s
|
||||
are taken into consideration.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>year</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The year is between 1 and 32767 inclusive.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &true; if the date given is valid; otherwise returns &false;.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>checkdate</function> example</title>
|
||||
|
@ -58,8 +83,15 @@ bool(false)
|
|||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>mktime</function> and <function>strtotime</function>.
|
||||
<simplelist>
|
||||
<member><function>mktime</function></member>
|
||||
<member><function>strtotime</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.date-sunrise">
|
||||
<refnamediv>
|
||||
<refname>date_sunrise</refname>
|
||||
<refpurpose>
|
||||
Returns time of sunrise for a given day and location
|
||||
</refpurpose>
|
||||
<refpurpose>Returns time of sunrise for a given day and location</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>date_sunrise</methodname>
|
||||
<methodparam><type>int</type><parameter>timestamp</parameter></methodparam>
|
||||
|
@ -20,51 +19,107 @@
|
|||
</methodsynopsis>
|
||||
<para>
|
||||
<function>date_sunrise</function> returns the sunrise time for a given
|
||||
day (specified as a <parameter>timestamp</parameter>) and location. The
|
||||
<parameter>latitude</parameter>, <parameter>longitude</parameter> and
|
||||
<parameter>zenith</parameter> parameters default to the
|
||||
<literal>date.default_latitude</literal>,
|
||||
<literal>date.default_longitude</literal> and
|
||||
<literal>date.sunrise_zenith</literal> configuration options,
|
||||
respectively.
|
||||
day (specified as a <parameter>timestamp</parameter>) and location.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
The <parameter>latitude</parameter> defaults to North. So, if you want to
|
||||
specify a South value, you must pass a negative value. The same note
|
||||
applies to <parameter>longitude</parameter>, which defaults to East.
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>timestamp</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <parameter>timestamp</parameter> of the day from which the sunrise
|
||||
time is taken.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>format</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<table>
|
||||
<title><parameter>format</parameter> constants</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>constant</entry>
|
||||
<entry>description</entry>
|
||||
<entry>example</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>SUNFUNCS_RET_STRING</entry>
|
||||
<entry>returns the result as <type>string</type></entry>
|
||||
<entry>16:46</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SUNFUNCS_RET_DOUBLE</entry>
|
||||
<entry>returns the result as <type>float</type></entry>
|
||||
<entry>16.78243132</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SUNFUNCS_RET_TIMESTAMP</entry>
|
||||
<entry>returns the result as <type>integer</type> (timestamp)</entry>
|
||||
<entry>1095034606</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>latitude</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Defaults to North, pass in a negative value for South.
|
||||
See also: <literal>date.default_latitude</literal>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>longitude</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Defaults to East, pass in a negative value for West.
|
||||
See also: <literal>date.default_longitude</literal>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>zenith</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Default: <literal>date.sunrise_zenith</literal>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>gmtoffset</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specified in hours.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
The <parameter>gmt_offset</parameter> parameter is specified in hours.
|
||||
Returns the sunrise time in a specified <parameter>format</parameter> on
|
||||
success, or &false; on failure.
|
||||
</para>
|
||||
<table>
|
||||
<title><parameter>format</parameter> constants</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>constant</entry>
|
||||
<entry>description</entry>
|
||||
<entry>example</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>SUNFUNCS_RET_STRING</entry>
|
||||
<entry>returns the result as <type>string</type></entry>
|
||||
<entry>16:46</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SUNFUNCS_RET_DOUBLE</entry>
|
||||
<entry>returns the result as <type>float</type></entry>
|
||||
<entry>16.78243132</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SUNFUNCS_RET_TIMESTAMP</entry>
|
||||
<entry>returns the result as <type>integer</type> (timestamp)</entry>
|
||||
<entry>1095034606</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>date_sunrise</function> example</title>
|
||||
|
@ -92,8 +147,14 @@ Mon Dec 20 2004, sunrise time : 08:54
|
|||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>date_sunset</function>.
|
||||
<simplelist>
|
||||
<member><function>date_sunset</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.date-sunset">
|
||||
<refnamediv>
|
||||
<refname>date_sunset</refname>
|
||||
|
@ -7,8 +7,9 @@
|
|||
Returns time of sunset for a given day and location
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>date_sunset</methodname>
|
||||
<methodparam><type>int</type><parameter>timestamp</parameter></methodparam>
|
||||
|
@ -17,54 +18,110 @@
|
|||
<methodparam choice="opt"><type>float</type><parameter>longitude</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>float</type><parameter>zenith</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>float</type><parameter>gmt_offset</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
<function>date_sunset</function> returns the sunset time for a given
|
||||
day (specified as a <parameter>timestamp</parameter>) and location.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<function>date_sunset</function> returns the sunset time for a given day
|
||||
(specified as a <parameter>timestamp</parameter>) and location. The
|
||||
<parameter>latitude</parameter>, <parameter>longitude</parameter> and
|
||||
<parameter>zenith</parameter> parameters default to the
|
||||
<literal>date.default_latitude</literal>,
|
||||
<literal>date.default_longitude</literal> and
|
||||
<literal>date.sunset_zenith</literal> configuration options,
|
||||
respectively.
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>timestamp</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The <parameter>timestamp</parameter> of the day from which the sunset
|
||||
time is taken.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>format</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<table>
|
||||
<title><parameter>format</parameter> constants</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>constant</entry>
|
||||
<entry>description</entry>
|
||||
<entry>example</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>SUNFUNCS_RET_STRING</entry>
|
||||
<entry>returns the result as <type>string</type></entry>
|
||||
<entry>16:46</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SUNFUNCS_RET_DOUBLE</entry>
|
||||
<entry>returns the result as <type>float</type></entry>
|
||||
<entry>16.78243132</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SUNFUNCS_RET_TIMESTAMP</entry>
|
||||
<entry>returns the result as <type>integer</type> (timestamp)</entry>
|
||||
<entry>1095034606</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>latitude</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Defaults to North, pass in a negative value for South.
|
||||
See also: <literal>date.default_latitude</literal>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>longitude</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Defaults to East, pass in a negative value for West.
|
||||
See also: <literal>date.default_longitude</literal>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>zenith</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Default: <literal>date.sunrise_zenith</literal>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>gmtoffset</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Specified in hours.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
The <parameter>latitude</parameter> defaults to North. So, if you want to
|
||||
specify a South value, you must pass a negative value. The same note
|
||||
applies to <parameter>longitude</parameter>, which defaults to East.
|
||||
Returns the sunset time in a specified <parameter>format</parameter> on
|
||||
success, or &false; on failure.
|
||||
</para>
|
||||
<para>
|
||||
The <parameter>gmt_offset</parameter> parameter is specified in hours.
|
||||
</para>
|
||||
<table>
|
||||
<title><parameter>format</parameter> constants</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>constant</entry>
|
||||
<entry>description</entry>
|
||||
<entry>example</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>SUNFUNCS_RET_STRING</entry>
|
||||
<entry>returns the result as <type>string</type></entry>
|
||||
<entry>16:46</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SUNFUNCS_RET_DOUBLE</entry>
|
||||
<entry>returns the result as <type>float</type></entry>
|
||||
<entry>16.78243132</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>SUNFUNCS_RET_TIMESTAMP</entry>
|
||||
<entry>returns the result as <type>integer</type> (timestamp)</entry>
|
||||
<entry>1095034606</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>date_sunset</function> example</title>
|
||||
|
@ -92,12 +149,19 @@ Mon Dec 20 2004, sunset time : 18:13
|
|||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>date_sunrise</function>.
|
||||
<simplelist>
|
||||
<member><function>date_sunrise</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.28 $ -->
|
||||
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
|
||||
<!-- $Revision: 1.29 $ -->
|
||||
<refentry id="function.date">
|
||||
<refnamediv>
|
||||
<refname>date</refname>
|
||||
<refpurpose>Format a local time/date</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>date</methodname>
|
||||
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
||||
|
@ -19,283 +19,320 @@
|
|||
if no timestamp is given. In other words, <parameter>timestamp</parameter>
|
||||
is optional and defaults to the value of <function>time</function>.
|
||||
</para>
|
||||
<tip>
|
||||
<para>
|
||||
Since PHP 5.1.1 there are a couple of useful <link
|
||||
linkend="datetime.constants">constants</link> of standard date/time
|
||||
formats that can be used to specify the <parameter>format</parameter>
|
||||
parameter.
|
||||
</para>
|
||||
</tip>
|
||||
<tip>
|
||||
<para>
|
||||
Timestamp of the start of the request is available in
|
||||
<varname>$_SERVER['REQUEST_TIME']</varname> since PHP 5.1.
|
||||
</para>
|
||||
</tip>
|
||||
<note>
|
||||
<para>
|
||||
The valid range of a timestamp is typically from Fri, 13 Dec
|
||||
1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are
|
||||
the dates that correspond to the minimum and maximum values for
|
||||
a 32-bit signed integer). However, before PHP 5.1 this range was limited
|
||||
from 01-01-1970 to 19-01-2038 on some systems (e.g. Windows).
|
||||
</para>
|
||||
</note>
|
||||
<note>
|
||||
<para>
|
||||
To generate a timestamp from a string representation of the date, you
|
||||
may be able to use <function>strtotime</function>. Additionally, some
|
||||
databases have functions to convert their date formats into timestamps
|
||||
(such as MySQL's <ulink url="&url.mysql.docs.date;">UNIX_TIMESTAMP</ulink>
|
||||
function).
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<table>
|
||||
<title>The following characters are recognized in the
|
||||
<parameter>format</parameter> parameter string</title>
|
||||
<tgroup cols="3">
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>format</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The format of the outputted date <type>string</type>. See the formatting
|
||||
options below.
|
||||
</para>
|
||||
<para>
|
||||
<table>
|
||||
<title>The following characters are recognized in the
|
||||
<parameter>format</parameter> parameter string</title>
|
||||
<tgroup cols="3">
|
||||
<thead>
|
||||
<row>
|
||||
<entry><parameter>format</parameter> character</entry>
|
||||
<entry>Description</entry>
|
||||
<entry>Example returned values</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Day</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>d</literal></entry>
|
||||
<entry>Day of the month, 2 digits with leading zeros</entry>
|
||||
<entry><literal>01</literal> to <literal>31</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>D</literal></entry>
|
||||
<entry>A textual representation of a day, three letters</entry>
|
||||
<entry><literal>Mon</literal> through <literal>Sun</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>j</literal></entry>
|
||||
<entry>Day of the month without leading zeros</entry>
|
||||
<entry><literal>1</literal> to <literal>31</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>l</literal> (lowercase 'L')</entry>
|
||||
<entry>A full textual representation of the day of the week</entry>
|
||||
<entry><literal>Sunday</literal> through <literal>Saturday</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>N</literal></entry>
|
||||
<entry>ISO-8601 numeric representation of the day of the week (added in
|
||||
PHP 5.1.0)</entry>
|
||||
<entry><literal>1</literal> (for Monday) through <literal>7</literal> (for Sunday)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>S</literal></entry>
|
||||
<entry>English ordinal suffix for the day of the month, 2 characters</entry>
|
||||
<entry>
|
||||
<literal>st</literal>, <literal>nd</literal>, <literal>rd</literal> or
|
||||
<literal>th</literal>. Works well with <literal>j</literal>
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>w</literal></entry>
|
||||
<entry>Numeric representation of the day of the week</entry>
|
||||
<entry><literal>0</literal> (for Sunday) through <literal>6</literal> (for Saturday)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>z</literal></entry>
|
||||
<entry>The day of the year (starting from 0)</entry>
|
||||
<entry><literal>0</literal> through <literal>365</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Week</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>W</literal></entry>
|
||||
<entry>ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0)</entry>
|
||||
<entry>Example: <literal>42</literal> (the 42nd week in the year)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Month</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>F</literal></entry>
|
||||
<entry>A full textual representation of a month, such as January or March</entry>
|
||||
<entry><literal>January</literal> through <literal>December</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>m</literal></entry>
|
||||
<entry>Numeric representation of a month, with leading zeros</entry>
|
||||
<entry><literal>01</literal> through <literal>12</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>M</literal></entry>
|
||||
<entry>A short textual representation of a month, three letters</entry>
|
||||
<entry><literal>Jan</literal> through <literal>Dec</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>n</literal></entry>
|
||||
<entry>Numeric representation of a month, without leading zeros</entry>
|
||||
<entry><literal>1</literal> through <literal>12</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>t</literal></entry>
|
||||
<entry>Number of days in the given month</entry>
|
||||
<entry><literal>28</literal> through <literal>31</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Year</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>L</literal></entry>
|
||||
<entry>Whether it's a leap year</entry>
|
||||
<entry><literal>1</literal> if it is a leap year, <literal>0</literal> otherwise.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>o</literal></entry>
|
||||
<entry>ISO-8601 year number. This has the same value as
|
||||
<literal>Y</literal>, except that if the ISO week number
|
||||
(<literal>W</literal>) belongs to the previous or next year, that year
|
||||
is used instead. (added in PHP 5.1.0)</entry>
|
||||
<entry>Examples: <literal>1999</literal> or <literal>2003</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>Y</literal></entry>
|
||||
<entry>A full numeric representation of a year, 4 digits</entry>
|
||||
<entry>Examples: <literal>1999</literal> or <literal>2003</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>y</literal></entry>
|
||||
<entry>A two digit representation of a year</entry>
|
||||
<entry>Examples: <literal>99</literal> or <literal>03</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Time</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>a</literal></entry>
|
||||
<entry>Lowercase Ante meridiem and Post meridiem</entry>
|
||||
<entry><literal>am</literal> or <literal>pm</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>A</literal></entry>
|
||||
<entry>Uppercase Ante meridiem and Post meridiem</entry>
|
||||
<entry><literal>AM</literal> or <literal>PM</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>B</literal></entry>
|
||||
<entry>Swatch Internet time</entry>
|
||||
<entry><literal>000</literal> through <literal>999</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>g</literal></entry>
|
||||
<entry>12-hour format of an hour without leading zeros</entry>
|
||||
<entry><literal>1</literal> through <literal>12</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>G</literal></entry>
|
||||
<entry>24-hour format of an hour without leading zeros</entry>
|
||||
<entry><literal>0</literal> through <literal>23</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>h</literal></entry>
|
||||
<entry>12-hour format of an hour with leading zeros</entry>
|
||||
<entry><literal>01</literal> through <literal>12</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>H</literal></entry>
|
||||
<entry>24-hour format of an hour with leading zeros</entry>
|
||||
<entry><literal>00</literal> through <literal>23</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>i</literal></entry>
|
||||
<entry>Minutes with leading zeros</entry>
|
||||
<entry><literal>00</literal> to <literal>59</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>s</literal></entry>
|
||||
<entry>Seconds, with leading zeros</entry>
|
||||
<entry><literal>00</literal> through <literal>59</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Timezone</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>e</literal></entry>
|
||||
<entry>Timezone identifier (added in PHP 5.1.0)</entry>
|
||||
<entry>Examples: <literal>UTC</literal>, <literal>GMT</literal>, <literal>Atlantic/Azores</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>I</literal> (capital i)</entry>
|
||||
<entry>Whether or not the date is in daylights savings time</entry>
|
||||
<entry><literal>1</literal> if Daylight Savings Time, <literal>0</literal> otherwise.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>O</literal></entry>
|
||||
<entry>Difference to Greenwich time (GMT) in hours</entry>
|
||||
<entry>Example: <literal>+0200</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>P</literal></entry>
|
||||
<entry>Difference to Greenwich time (GMT) with colon between hours and minutes (added in PHP 5.1.3)</entry>
|
||||
<entry>Example: <literal>+02:00</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>T</literal></entry>
|
||||
<entry>Timezone setting of this machine</entry>
|
||||
<entry>Examples: <literal>EST</literal>, <literal>MDT</literal> ...</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>Z</literal></entry>
|
||||
<entry>Timezone offset in seconds. The offset for timezones west of UTC is always
|
||||
negative, and for those east of UTC is always positive.</entry>
|
||||
<entry><literal>-43200</literal> through <literal>43200</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Full Date/Time</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>c</literal></entry>
|
||||
<entry>ISO 8601 date (added in PHP 5)</entry>
|
||||
<entry>2004-02-12T15:19:21+00:00</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>r</literal></entry>
|
||||
<entry><ulink url="&url.rfc;2822">RFC 2822</ulink> formatted date</entry>
|
||||
<entry>Example: <literal>Thu, 21 Dec 2000 16:01:07 +0200</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>U</literal></entry>
|
||||
<entry>Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)</entry>
|
||||
<entry>See also <function>time</function></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<para>
|
||||
Unrecognized characters in the format string will be printed
|
||||
as-is. The <literal>Z</literal> format will always return
|
||||
<literal>0</literal> when using <function>gmdate</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
&date.timestamp.description;
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns a formatted date string. If a non-numeric value is used for
|
||||
<parameter>timestamp</parameter>, &false; is returned and an
|
||||
<literal>E_WARNING</literal> level error is emitted.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry><parameter>format</parameter> character</entry>
|
||||
<entry>Description</entry>
|
||||
<entry>Example returned values</entry>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Day</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>d</literal></entry>
|
||||
<entry>Day of the month, 2 digits with leading zeros</entry>
|
||||
<entry><literal>01</literal> to <literal>31</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>D</literal></entry>
|
||||
<entry>A textual representation of a day, three letters</entry>
|
||||
<entry><literal>Mon</literal> through <literal>Sun</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>j</literal></entry>
|
||||
<entry>Day of the month without leading zeros</entry>
|
||||
<entry><literal>1</literal> to <literal>31</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>l</literal> (lowercase 'L')</entry>
|
||||
<entry>A full textual representation of the day of the week</entry>
|
||||
<entry><literal>Sunday</literal> through <literal>Saturday</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>N</literal></entry>
|
||||
<entry>ISO-8601 numeric representation of the day of the week (added in
|
||||
PHP 5.1.0)</entry>
|
||||
<entry><literal>1</literal> (for Monday) through <literal>7</literal> (for Sunday)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>S</literal></entry>
|
||||
<entry>English ordinal suffix for the day of the month, 2 characters</entry>
|
||||
<entry>5.1.0</entry>
|
||||
<entry>
|
||||
<literal>st</literal>, <literal>nd</literal>, <literal>rd</literal> or
|
||||
<literal>th</literal>. Works well with <literal>j</literal>
|
||||
The valid range of a timestamp is typically from Fri, 13 Dec
|
||||
1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are
|
||||
the dates that correspond to the minimum and maximum values for
|
||||
a 32-bit signed integer). However, before PHP 5.1.0 this range was limited
|
||||
from 01-01-1970 to 19-01-2038 on some systems (e.g. Windows).
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>w</literal></entry>
|
||||
<entry>Numeric representation of the day of the week</entry>
|
||||
<entry><literal>0</literal> (for Sunday) through <literal>6</literal> (for Saturday)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>z</literal></entry>
|
||||
<entry>The day of the year (starting from 0)</entry>
|
||||
<entry><literal>0</literal> through <literal>365</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Week</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>W</literal></entry>
|
||||
<entry>ISO-8601 week number of year, weeks starting on Monday (added in PHP 4.1.0)</entry>
|
||||
<entry>Example: <literal>42</literal> (the 42nd week in the year)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Month</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>F</literal></entry>
|
||||
<entry>A full textual representation of a month, such as January or March</entry>
|
||||
<entry><literal>January</literal> through <literal>December</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>m</literal></entry>
|
||||
<entry>Numeric representation of a month, with leading zeros</entry>
|
||||
<entry><literal>01</literal> through <literal>12</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>M</literal></entry>
|
||||
<entry>A short textual representation of a month, three letters</entry>
|
||||
<entry><literal>Jan</literal> through <literal>Dec</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>n</literal></entry>
|
||||
<entry>Numeric representation of a month, without leading zeros</entry>
|
||||
<entry><literal>1</literal> through <literal>12</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>t</literal></entry>
|
||||
<entry>Number of days in the given month</entry>
|
||||
<entry><literal>28</literal> through <literal>31</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Year</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>L</literal></entry>
|
||||
<entry>Whether it's a leap year</entry>
|
||||
<entry><literal>1</literal> if it is a leap year, <literal>0</literal> otherwise.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>o</literal></entry>
|
||||
<entry>ISO-8601 year number. This has the same value as
|
||||
<literal>Y</literal>, except that if the ISO week number
|
||||
(<literal>W</literal>) belongs to the previous or next year, that year
|
||||
is used instead. (added in PHP 5.1.0)</entry>
|
||||
<entry>Examples: <literal>1999</literal> or <literal>2003</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>Y</literal></entry>
|
||||
<entry>A full numeric representation of a year, 4 digits</entry>
|
||||
<entry>Examples: <literal>1999</literal> or <literal>2003</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>y</literal></entry>
|
||||
<entry>A two digit representation of a year</entry>
|
||||
<entry>Examples: <literal>99</literal> or <literal>03</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Time</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>a</literal></entry>
|
||||
<entry>Lowercase Ante meridiem and Post meridiem</entry>
|
||||
<entry><literal>am</literal> or <literal>pm</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>A</literal></entry>
|
||||
<entry>Uppercase Ante meridiem and Post meridiem</entry>
|
||||
<entry><literal>AM</literal> or <literal>PM</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>B</literal></entry>
|
||||
<entry>Swatch Internet time</entry>
|
||||
<entry><literal>000</literal> through <literal>999</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>g</literal></entry>
|
||||
<entry>12-hour format of an hour without leading zeros</entry>
|
||||
<entry><literal>1</literal> through <literal>12</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>G</literal></entry>
|
||||
<entry>24-hour format of an hour without leading zeros</entry>
|
||||
<entry><literal>0</literal> through <literal>23</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>h</literal></entry>
|
||||
<entry>12-hour format of an hour with leading zeros</entry>
|
||||
<entry><literal>01</literal> through <literal>12</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>H</literal></entry>
|
||||
<entry>24-hour format of an hour with leading zeros</entry>
|
||||
<entry><literal>00</literal> through <literal>23</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>i</literal></entry>
|
||||
<entry>Minutes with leading zeros</entry>
|
||||
<entry><literal>00</literal> to <literal>59</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>s</literal></entry>
|
||||
<entry>Seconds, with leading zeros</entry>
|
||||
<entry><literal>00</literal> through <literal>59</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Timezone</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>e</literal></entry>
|
||||
<entry>Timezone identifier (added in PHP 5.1.0)</entry>
|
||||
<entry>Examples: <literal>UTC</literal>, <literal>GMT</literal>, <literal>Atlantic/Azores</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>I</literal> (capital i)</entry>
|
||||
<entry>Whether or not the date is in daylights savings time</entry>
|
||||
<entry><literal>1</literal> if Daylight Savings Time, <literal>0</literal> otherwise.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>O</literal></entry>
|
||||
<entry>Difference to Greenwich time (GMT) in hours</entry>
|
||||
<entry>Example: <literal>+0200</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>P</literal></entry>
|
||||
<entry>Difference to Greenwich time (GMT) with colon between hours and minutes (added in PHP 5.1.3)</entry>
|
||||
<entry>Example: <literal>+02:00</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>T</literal></entry>
|
||||
<entry>Timezone setting of this machine</entry>
|
||||
<entry>Examples: <literal>EST</literal>, <literal>MDT</literal> ...</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>Z</literal></entry>
|
||||
<entry>Timezone offset in seconds. The offset for timezones west of UTC is always
|
||||
negative, and for those east of UTC is always positive.</entry>
|
||||
<entry><literal>-43200</literal> through <literal>43200</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry align="center"><emphasis>Full Date/Time</emphasis></entry>
|
||||
<entry>---</entry>
|
||||
<entry>---</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>c</literal></entry>
|
||||
<entry>ISO 8601 date (added in PHP 5)</entry>
|
||||
<entry>2004-02-12T15:19:21+00:00</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>r</literal></entry>
|
||||
<entry><ulink url="&url.rfc;2822">RFC 2822</ulink> formatted date</entry>
|
||||
<entry>Example: <literal>Thu, 21 Dec 2000 16:01:07 +0200</literal></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>U</literal></entry>
|
||||
<entry>Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)</entry>
|
||||
<entry>See also <function>time</function></entry>
|
||||
<entry>5.1.1</entry>
|
||||
<entry>
|
||||
There are useful <link linkend="datetime.constants">constants</link>
|
||||
of standard date/time formats that can be used to specify the
|
||||
<parameter>format</parameter> parameter.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
<para>
|
||||
Unrecognized characters in the format string will be printed
|
||||
as-is. The <literal>Z</literal> format will always return
|
||||
<literal>0</literal> when using <function>gmdate</function>.
|
||||
</informaltable>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>date</function> examples</title>
|
||||
|
@ -400,10 +437,37 @@ $today = date("H:i:s"); // 17:16:17
|
|||
<function>setlocale</function> and <function>strftime</function>
|
||||
functions instead of <function>date</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
<note>
|
||||
<para>
|
||||
To generate a timestamp from a string representation of the date, you
|
||||
may be able to use <function>strtotime</function>. Additionally, some
|
||||
databases have functions to convert their date formats into timestamps
|
||||
(such as MySQL's <ulink url="&url.mysql.docs.date;">UNIX_TIMESTAMP</ulink>
|
||||
function).
|
||||
</para>
|
||||
</note>
|
||||
<tip>
|
||||
<para>
|
||||
Timestamp of the start of the request is available in
|
||||
<varname>$_SERVER['REQUEST_TIME']</varname> since PHP 5.1.
|
||||
</para>
|
||||
</tip>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>getlastmod</function>, <function>gmdate</function>,
|
||||
<function>mktime</function>, <function>strftime</function>
|
||||
and <function>time</function>.
|
||||
<simplelist>
|
||||
<member><function>getlastmod</function></member>
|
||||
<member><function>gmdate</function></member>
|
||||
<member><function>mktime</function></member>
|
||||
<member><function>strftime</function></member>
|
||||
<member><function>time</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<refentry id="function.getdate">
|
||||
<refnamediv>
|
||||
<refname>getdate</refname>
|
||||
<refpurpose>Get date/time information</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>getdate</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>timestamp</parameter></methodparam>
|
||||
|
@ -15,8 +15,27 @@
|
|||
<para>
|
||||
Returns an associative <type>array</type> containing the date
|
||||
information of the <parameter>timestamp</parameter>, or the current
|
||||
local time if no <parameter>timestamp</parameter> is given, as the
|
||||
following associative array elements:
|
||||
local time if no <parameter>timestamp</parameter> is given.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
|
||||
&date.timestamp.description;
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns an associative <type>array</type> of information related to
|
||||
the <parameter>typestamp</parameter>. Elements from the returned
|
||||
associative array are as follows:
|
||||
</para>
|
||||
<para>
|
||||
<table>
|
||||
|
@ -95,6 +114,10 @@
|
|||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>getdate</function> example</title>
|
||||
|
@ -127,10 +150,16 @@ Array
|
|||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>date</function>,
|
||||
<function>time</function>, and
|
||||
<function>setlocale</function>.
|
||||
<simplelist>
|
||||
<member><function>date</function></member>
|
||||
<member><function>time</function></member>
|
||||
<member><function>setlocale</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.gettimeofday">
|
||||
<refnamediv>
|
||||
<refname>gettimeofday</refname>
|
||||
<refpurpose>Get current time</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>gettimeofday</methodname>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>return_float</parameter></methodparam>
|
||||
|
@ -17,11 +17,29 @@
|
|||
associative array containing the data returned from the system
|
||||
call.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
Since PHP 5.1.0 there is an optional parameter,
|
||||
<parameter>return_float</parameter>, which makes
|
||||
<function>gettimeofday</function> return a float when it is set to
|
||||
&true;.
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>return_float</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
When set to &true;, a float instead of an array is returned.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
By default an <type>array</type> is returned. If <parameter>return_float</parameter>
|
||||
is set, then a <type>foat</type> is returned.
|
||||
</para>
|
||||
<para>
|
||||
Array keys:
|
||||
|
@ -48,6 +66,34 @@
|
|||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>5.1.0</entry>
|
||||
<entry>
|
||||
The <parameter>return_float</parameter> parameter was added.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>gettimeofday</function> example</title>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
|
||||
<!-- $Revision: 1.11 $ -->
|
||||
<refentry id="function.gmdate">
|
||||
<refnamediv>
|
||||
<refname>gmdate</refname>
|
||||
<refpurpose>Format a GMT/UTC date/time</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>gmdate</methodname>
|
||||
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
||||
|
@ -15,11 +15,84 @@
|
|||
</methodsynopsis>
|
||||
<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".
|
||||
the time returned is Greenwich Mean Time (GMT).
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>format</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The format of the outputted date <type>string</type>. See the formatting
|
||||
options for the <function>date</function> function.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
&date.timestamp.description;
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns a formatted date string. If a non-numeric value is used for
|
||||
<parameter>timestamp</parameter>, &false; is returned and an
|
||||
<literal>E_WARNING</literal> level error is emitted.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>5.1.0</entry>
|
||||
<entry>
|
||||
The valid range of a timestamp is typically from Fri, 13 Dec
|
||||
1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are
|
||||
the dates that correspond to the minimum and maximum values for
|
||||
a 32-bit signed integer). However, before PHP 5.1.0 this range was limited
|
||||
from 01-01-1970 to 19-01-2038 on some systems (e.g. Windows).
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>5.1.1</entry>
|
||||
<entry>
|
||||
There are useful <link linkend="datetime.constants">constants</link>
|
||||
of standard date/time formats that can be used to specify the
|
||||
<parameter>format</parameter> parameter.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>gmdate</function> example</title>
|
||||
<title><function>functionname</function> example</title>
|
||||
<para>
|
||||
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".
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
@ -30,15 +103,17 @@ echo gmdate("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 1998));
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Prior to PHP 5.1.0, negative timestamps (dates before 1970) didn't work on
|
||||
some systems (Windows, for example).
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>date</function>, <function>mktime</function>,
|
||||
<function>gmmktime</function> and <function>strftime</function>.
|
||||
<simplelist>
|
||||
<member><function>date</function></member>
|
||||
<member><function>mktime</function></member>
|
||||
<member><function>gmmktime</function></member>
|
||||
<member><function>strftime</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
|
||||
<!-- $Revision: 1.10 $ -->
|
||||
<refentry id="function.gmmktime">
|
||||
<refnamediv>
|
||||
<refname>gmmktime</refname>
|
||||
<refpurpose>Get Unix timestamp for a GMT date</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>gmmktime</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>hour</parameter></methodparam>
|
||||
|
@ -19,32 +19,118 @@
|
|||
<methodparam choice="opt"><type>int</type><parameter>is_dst</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Identical to <function>mktime</function> except the passed
|
||||
parameters represents a GMT date.
|
||||
</para>
|
||||
<para>
|
||||
Parameters always represent a GMT date so <parameter>is_dst</parameter>
|
||||
doesn't influence the result.
|
||||
Identical to <function>mktime</function> except the passed parameters represents a
|
||||
GMT date. <function>gmmktime</function> internally uses <function>mktime</function>
|
||||
so only times valid in derived local time can be used.
|
||||
</para>
|
||||
<para>
|
||||
Like <function>mktime</function>, arguments may be left out in order
|
||||
from right to left, with any omitted arguments being set to the
|
||||
current corresponding GMT value.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
As of PHP 5.1.0, the <parameter>is_dst</parameter> parameter became
|
||||
deprecated. As a result, the new timezone handling features should be used
|
||||
instead.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>hour</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The hour
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>minute</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The minute
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>second</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The second
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>month</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The month
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>day</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The day
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>year</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The year
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>is_dst</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Parameters always represent a GMT date so <parameter>is_dst</parameter>
|
||||
doesn't influence the result.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns a <type>integer</type> Unix timestamp.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<para>
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>5.1.0</entry>
|
||||
<entry>
|
||||
As of PHP 5.1.0, the <parameter>is_dst</parameter> parameter became
|
||||
deprecated. As a result, the new timezone handling features should be used
|
||||
instead.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<note>
|
||||
<simpara>
|
||||
<function>gmmktime</function> internaly uses <function>mktime</function>
|
||||
so only times valid in derived local time can be used.
|
||||
</simpara>
|
||||
</note>
|
||||
<example>
|
||||
<title><function>gmmktime</function> on Windows boundary</title>
|
||||
<programlisting role="php">
|
||||
|
@ -56,9 +142,16 @@ gmmktime(0, 0, 0, 1, 1, 1970); // valid in GMT and west, invalid in east
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>mktime</function>,
|
||||
<function>date</function> and <function>time</function>.
|
||||
<simplelist>
|
||||
<member><function>mktime</function></member>
|
||||
<member><function>date</function></member>
|
||||
<member><function>time</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<refentry id="function.gmstrftime">
|
||||
<refnamediv>
|
||||
<refname>gmstrftime</refname>
|
||||
<refpurpose>Format a GMT/UTC time/date according to locale settings</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>gmstrftime</methodname>
|
||||
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
||||
|
@ -19,9 +19,15 @@
|
|||
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".
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>gmstrftime</function> example</title>
|
||||
<programlisting role="php">
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
setlocale(LC_TIME, 'en_US');
|
||||
|
@ -32,8 +38,14 @@ echo gmstrftime("%b %d %Y %H:%M:%S", mktime(20, 0, 0, 12, 31, 98)) . "\n";
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>strftime</function>.
|
||||
<simplelist>
|
||||
<member><function>strftime</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry id="function.idate">
|
||||
<refnamediv>
|
||||
<refname>idate</refname>
|
||||
<refpurpose>Format a local time/date as integer</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>idate</methodname>
|
||||
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
||||
|
@ -22,103 +23,129 @@
|
|||
Unlike the function <function>date</function>, <function>idate</function>
|
||||
accepts just one char in the <parameter>format</parameter> parameter.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<table>
|
||||
<title>The following characters are recognized in the
|
||||
<parameter>format</parameter> parameter string</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry><parameter>format</parameter> character</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>B</literal></entry>
|
||||
<entry>Swatch Beat/Internet Time</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>d</literal></entry>
|
||||
<entry>Day of the month</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>h</literal></entry>
|
||||
<entry>Hour (12 hour format)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>H</literal></entry>
|
||||
<entry>Hour (24 hour format)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>i</literal></entry>
|
||||
<entry>Minutes</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>I</literal></entry>
|
||||
<entry>returns <literal>1</literal> if DST is activated,
|
||||
<literal>0</literal> otherwise</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>L</literal></entry>
|
||||
<entry>returns <literal>1</literal> for leap year,
|
||||
<literal>0</literal> otherwise</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>m</literal></entry>
|
||||
<entry>Month number</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>s</literal></entry>
|
||||
<entry>Seconds</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>t</literal></entry>
|
||||
<entry>Days in current month</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>U</literal></entry>
|
||||
<entry>Seconds since the Unix Epoch - January 1 1970 00:00:00 GMT -
|
||||
this is the same as <function>time</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>w</literal></entry>
|
||||
<entry>Day of the week (<literal>0</literal> on Sunday)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>W</literal></entry>
|
||||
<entry>ISO-8601 week number of year, weeks starting on
|
||||
Monday</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>y</literal></entry>
|
||||
<entry>Year (1 or 2 digits - check note below)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>Y</literal></entry>
|
||||
<entry>Year (4 digits)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>z</literal></entry>
|
||||
<entry>Day of the year</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>Z</literal></entry>
|
||||
<entry>Timezone offset in seconds</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>format</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
<table>
|
||||
<title>The following characters are recognized in the
|
||||
<parameter>format</parameter> parameter string</title>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry><parameter>format</parameter> character</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry><literal>B</literal></entry>
|
||||
<entry>Swatch Beat/Internet Time</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>d</literal></entry>
|
||||
<entry>Day of the month</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>h</literal></entry>
|
||||
<entry>Hour (12 hour format)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>H</literal></entry>
|
||||
<entry>Hour (24 hour format)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>i</literal></entry>
|
||||
<entry>Minutes</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>I</literal></entry>
|
||||
<entry>returns <literal>1</literal> if DST is activated,
|
||||
<literal>0</literal> otherwise</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>L</literal></entry>
|
||||
<entry>returns <literal>1</literal> for leap year,
|
||||
<literal>0</literal> otherwise</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>m</literal></entry>
|
||||
<entry>Month number</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>s</literal></entry>
|
||||
<entry>Seconds</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>t</literal></entry>
|
||||
<entry>Days in current month</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>U</literal></entry>
|
||||
<entry>Seconds since the Unix Epoch - January 1 1970 00:00:00 GMT -
|
||||
this is the same as <function>time</function></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>w</literal></entry>
|
||||
<entry>Day of the week (<literal>0</literal> on Sunday)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>W</literal></entry>
|
||||
<entry>ISO-8601 week number of year, weeks starting on
|
||||
Monday</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>y</literal></entry>
|
||||
<entry>Year (1 or 2 digits - check note below)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>Y</literal></entry>
|
||||
<entry>Year (4 digits)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>z</literal></entry>
|
||||
<entry>Day of the year</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><literal>Z</literal></entry>
|
||||
<entry>Timezone offset in seconds</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
&date.timestamp.description;
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
As <function>idate</function> always returns an <type>integer</type> and
|
||||
as they can't start with a "0", <function>idate</function> may return
|
||||
fewer digits than you would expect. See the example below:
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
<informalexample>
|
||||
Returns an <type>integer</type>.
|
||||
</para>
|
||||
<para>
|
||||
As <function>idate</function> always returns an <type>integer</type> and
|
||||
as they can't start with a "0", <function>idate</function> may return
|
||||
fewer digits than you would expect. See the example below:
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>idate</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
@ -131,11 +158,17 @@ echo idate('y', $timestamp);
|
|||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>date</function> and
|
||||
<function>time</function>.
|
||||
<simplelist>
|
||||
<member><function>date</function></member>
|
||||
<member><function>time</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.10 -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<refentry id="function.localtime">
|
||||
<refnamediv>
|
||||
<refname>localtime</refname>
|
||||
<refpurpose>Get the local time</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>localtime</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>timestamp</parameter></methodparam>
|
||||
|
@ -16,70 +16,88 @@
|
|||
<para>
|
||||
The <function>localtime</function> function returns an array
|
||||
identical to that of the structure returned by the C function
|
||||
call. The first argument to <function>localtime</function> is
|
||||
the timestamp, if this is not given the current time as returned
|
||||
from <function>time</function> is used.
|
||||
The second argument to the <function>localtime</function> is the
|
||||
<parameter>is_associative</parameter>, if this is set to &false; or not
|
||||
supplied than the array is returned as a regular, numerically
|
||||
indexed array. If the argument is set to &true; then
|
||||
<function>localtime</function> is an associative array containing
|
||||
all the different elements of the structure returned by the C
|
||||
function call to localtime. The names of the different keys of
|
||||
the associative array are as follows:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_sec" - seconds
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_min" - minutes
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_hour" - hour
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_mday" - day of the month
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_mon" - month of the year, starting with 0 for January
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_year" - Years since 1900
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_wday" - Day of the week
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_yday" - Day of the year
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_isdst" - Is daylight savings time in effect
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
call.
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
Months are from 0 (Jan) to 11 (Dec) and days of the week are from 0 (Sun) to 6 (Sat).
|
||||
</simpara>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
|
||||
&date.timestamp.description;
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>is_associative</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If set to &false; or not supplied than the array is returned as a regular,
|
||||
numerically indexed array. If the argument is set to &true; then
|
||||
<function>localtime</function> is an associative array containing
|
||||
all the different elements of the structure returned by the C
|
||||
function call to localtime. The names of the different keys of
|
||||
the associative array are as follows:
|
||||
</para>
|
||||
<para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_sec" - seconds
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_min" - minutes
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_hour" - hour
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_mday" - day of the month
|
||||
</simpara>
|
||||
<simpara>
|
||||
Months are from 0 (Jan) to 11 (Dec) and days of the week are from 0 (Sun) to 6 (Sat).
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_mon" - month of the year, starting with 0 for January
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_year" - Years since 1900
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_wday" - Day of the week
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_yday" - Day of the year
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
"tm_isdst" - Is daylight savings time in effect
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>time</function> example</title>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
|
||||
<!-- $Revision: 1.14 $ -->
|
||||
<refentry id="function.microtime">
|
||||
<refnamediv>
|
||||
<refname>microtime</refname>
|
||||
<refpurpose>Return current Unix timestamp with microseconds</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>microtime</methodname>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>get_as_float</parameter></methodparam>
|
||||
|
@ -17,23 +17,58 @@
|
|||
microseconds. This function is only available on operating systems that
|
||||
support the gettimeofday() system call.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
When called without the optional argument, this function returns the string
|
||||
"msec sec" where sec is the current time measured in the number of
|
||||
seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and
|
||||
msec is the microseconds part.
|
||||
Both portions of the string are returned in units of seconds.
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>get_as_float</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
When called without the optional argument, this function returns the string
|
||||
"msec sec" where sec is the current time measured in the number of
|
||||
seconds since the Unix Epoch (0:00:00 January 1, 1970 GMT), and
|
||||
msec is the microseconds part.
|
||||
Both portions of the string are returned in units of seconds.
|
||||
</para>
|
||||
<para>
|
||||
If the optional <parameter>get_as_float</parameter> is set to
|
||||
&true; then a <type>float</type> (in seconds) is returned.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<para>
|
||||
When <parameter>get_as_float</parameter> is given, and evaluates to
|
||||
&true;, <function>microtime</function> will return a float.
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>5.0.0</entry>
|
||||
<entry>
|
||||
The <parameter>get_as_float</parameter> parameter was added.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</para>
|
||||
<note>
|
||||
<simpara>
|
||||
The <parameter>get_as_float</parameter> parameter was added as of
|
||||
PHP 5.0.0.
|
||||
</simpara>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Timing script execution with <function>microtime</function></title>
|
||||
|
@ -81,8 +116,14 @@ echo "Did nothing in $time seconds\n";
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>time</function>.
|
||||
<simplelist>
|
||||
<member><function>time</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.16 $ -->
|
||||
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
|
||||
<!-- $Revision: 1.17 $ -->
|
||||
<refentry id="function.strftime">
|
||||
<refnamediv>
|
||||
<refname>strftime</refname>
|
||||
<refpurpose>Format a local time/date according to locale settings</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>strftime</methodname>
|
||||
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
||||
|
@ -21,228 +21,250 @@
|
|||
with <function>setlocale</function>.
|
||||
</para>
|
||||
<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>
|
||||
%C - century number (the year divided by 100 and truncated to
|
||||
an integer, range 00 to 99)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%d - day of the month as a decimal number (range 01 to 31)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%D - same as %m/%d/%y
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%e - day of the month as a decimal number, a single digit is
|
||||
preceded by a space (range ' 1' to '31')
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%g - like %G, but without the century.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%G - The 4-digit year corresponding to the ISO week number (see %V).
|
||||
This has the same format and value as %Y, except that if the ISO week
|
||||
number belongs to the previous or next year, that year is used
|
||||
instead.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%h - same as %b
|
||||
</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 01 to 12)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%M - minute as a decimal number
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%n - newline character
|
||||
</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>
|
||||
%r - time in a.m. and p.m. notation
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%R - time in 24 hour notation
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%S - second as a decimal number
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%t - tab character
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%T - current time, equal to %H:%M:%S
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%u - weekday as a decimal number [1,7], with 1 representing
|
||||
Monday
|
||||
</simpara>
|
||||
<warning>
|
||||
<simpara>
|
||||
Sun Solaris seems to start with Sunday as 1
|
||||
although ISO 9889:1999 (the current C standard) clearly
|
||||
specifies that it should be Monday.
|
||||
</simpara>
|
||||
</warning>
|
||||
</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>
|
||||
%V - The ISO 8601:1988 week number of the current year as a
|
||||
decimal number, range 01 to 53, where week 1 is the first
|
||||
week that has at least 4 days in the current year, and with
|
||||
Monday as the first day of the week. (Use %G or %g for the year
|
||||
component that corresponds to the week number for the specified
|
||||
timestamp.)
|
||||
</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 or %z - time zone or name or abbreviation
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%% - a literal `%' character
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
<note>
|
||||
<para>
|
||||
Not all conversion specifiers may be supported by your C
|
||||
library, in which case they will not be supported by PHP's
|
||||
<function>strftime</function>. Additionally, not all platforms
|
||||
support negative timestamps, therefore your date range may
|
||||
be limited to no earlier than the Unix epoch. This means that
|
||||
e.g. %e, %T, %R and %D (there might be more) and dates prior to
|
||||
<literal>Jan 1, 1970</literal> will not work on Windows, some Linux
|
||||
distributions, and a few other operating systems. For Windows systems a
|
||||
complete overview of supported conversion specifiers can be found at this
|
||||
<ulink url="&url.strftime.win32;"><acronym>MSDN</acronym> website</ulink>.
|
||||
</para>
|
||||
</note>
|
||||
Not all conversion specifiers may be supported by your C
|
||||
library, in which case they will not be supported by PHP's
|
||||
<function>strftime</function>. Additionally, not all platforms
|
||||
support negative timestamps, therefore your date range may
|
||||
be limited to no earlier than the Unix epoch. This means that
|
||||
e.g. %e, %T, %R and %D (there might be more) and dates prior to
|
||||
<literal>Jan 1, 1970</literal> will not work on Windows, some Linux
|
||||
distributions, and a few other operating systems. For Windows systems a
|
||||
complete overview of supported conversion specifiers can be found at this
|
||||
<ulink url="&url.strftime.win32;"><acronym>MSDN</acronym> website</ulink>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>format</parameter></term>
|
||||
<listitem>
|
||||
<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>
|
||||
%C - century number (the year divided by 100 and truncated to
|
||||
an integer, range 00 to 99)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%d - day of the month as a decimal number (range 01 to 31)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%D - same as %m/%d/%y
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%e - day of the month as a decimal number, a single digit is
|
||||
preceded by a space (range ' 1' to '31')
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%g - like %G, but without the century.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%G - The 4-digit year corresponding to the ISO week number (see %V).
|
||||
This has the same format and value as %Y, except that if the ISO week
|
||||
number belongs to the previous or next year, that year is used
|
||||
instead.
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%h - same as %b
|
||||
</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 01 to 12)
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%M - minute as a decimal number
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%n - newline character
|
||||
</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>
|
||||
%r - time in a.m. and p.m. notation
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%R - time in 24 hour notation
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%S - second as a decimal number
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%t - tab character
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%T - current time, equal to %H:%M:%S
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%u - weekday as a decimal number [1,7], with 1 representing
|
||||
Monday
|
||||
</simpara>
|
||||
<warning>
|
||||
<simpara>
|
||||
Sun Solaris seems to start with Sunday as 1
|
||||
although ISO 9889:1999 (the current C standard) clearly
|
||||
specifies that it should be Monday.
|
||||
</simpara>
|
||||
</warning>
|
||||
</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>
|
||||
%V - The ISO 8601:1988 week number of the current year as a
|
||||
decimal number, range 01 to 53, where week 1 is the first
|
||||
week that has at least 4 days in the current year, and with
|
||||
Monday as the first day of the week. (Use %G or %g for the year
|
||||
component that corresponds to the week number for the specified
|
||||
timestamp.)
|
||||
</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 or %z - time zone or name or abbreviation
|
||||
</simpara>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<simpara>
|
||||
%% - a literal `%' character
|
||||
</simpara>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
&date.timestamp.description;
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
This example works if you have the respective locales installed
|
||||
in your system.
|
||||
<example>
|
||||
<title><function>strftime</function> locale examples</title>
|
||||
<programlisting role="php">
|
||||
|
@ -260,15 +282,6 @@ echo strftime(" in German %A.\n");
|
|||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
This example works if you have the respective locales installed
|
||||
in your system.
|
||||
<note>
|
||||
<simpara>
|
||||
%G and %V, which are based on ISO 8601:1988 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 week number example</title>
|
||||
<programlisting role="php">
|
||||
|
@ -323,12 +336,28 @@ echo "1/3/2005 - %V,%G,%Y = " . strftime("%V,%G,%Y",strtotime("1/3/2005")) . "\n
|
|||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
<note>
|
||||
<simpara>
|
||||
%G and %V, which are based on ISO 8601:1988 week numbers can
|
||||
give unexpected (albeit correct) results if the numbering system
|
||||
is not thoroughly understood. See %V examples in this manual page.
|
||||
</simpara>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>setlocale</function>,
|
||||
<function>mktime</function>,
|
||||
<function>strptime</function>,
|
||||
and the <ulink url="&spec.strftime;">
|
||||
Open Group specification of <function>strftime</function></ulink>.
|
||||
<simplelist>
|
||||
<member><function>setlocale</function></member>
|
||||
<member><function>mktime</function></member>
|
||||
<member><function>strptime</function></member>
|
||||
<member><ulink url="&spec.strftime;">Open Group specification of <function>strftime</function></ulink></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- splitted from ./en/functions/datetime.xml, last change in rev 1.2 -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<refentry id="function.time">
|
||||
<refnamediv>
|
||||
<refname>time</refname>
|
||||
<refpurpose>Return current Unix timestamp</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>time</methodname>
|
||||
<void/>
|
||||
|
@ -16,12 +16,10 @@
|
|||
Returns the current time measured in the number of seconds since
|
||||
the Unix Epoch (January 1 1970 00:00:00 GMT).
|
||||
</para>
|
||||
<tip>
|
||||
<para>
|
||||
Timestamp of the start of the request is available in
|
||||
<varname>$_SERVER['REQUEST_TIME']</varname> since PHP 5.1.
|
||||
</para>
|
||||
</tip>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>time</function> example</title>
|
||||
|
@ -44,8 +42,25 @@ Next Week: 2005-04-07
|
|||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
<tip>
|
||||
<para>
|
||||
Timestamp of the start of the request is available in
|
||||
<varname>$_SERVER['REQUEST_TIME']</varname> since PHP 5.1.
|
||||
</para>
|
||||
</tip>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
See also <function>date</function> and <function>microtime</function>.
|
||||
<simplelist>
|
||||
<member><function>date</function></member>
|
||||
<member><function>microtime</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
|
Loading…
Reference in a new issue