mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Document datetime classes
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@272892 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
c3ca4d0c94
commit
3f6baf5f2e
60 changed files with 3886 additions and 1301 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- Purpose: calendar -->
|
||||
<!-- Membership: core -->
|
||||
|
||||
|
@ -38,7 +38,12 @@
|
|||
&reference.datetime.setup;
|
||||
&reference.datetime.constants;
|
||||
&reference.datetime.timezones;
|
||||
<!-- FIXME: Apparently this extension defines a class.. -->
|
||||
|
||||
&reference.datetime.datetime;
|
||||
&reference.datetime.datetimezone;
|
||||
&reference.datetime.dateinterval;
|
||||
&reference.datetime.dateperiod;
|
||||
|
||||
&reference.datetime.reference;
|
||||
|
||||
</book>
|
||||
|
|
|
@ -1,135 +1,13 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.12 $ -->
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<appendix xml:id="datetime.constants" xmlns="http://docbook.org/ns/docbook">
|
||||
&reftitle.constants;
|
||||
<para>
|
||||
The following constants are defined since PHP 5.1.1 and they offer standard
|
||||
The <link linkend="datetime.constants.types"><literal>DATE_</literal>
|
||||
constants</link> are defined since PHP 5.1.1 and they offer standard
|
||||
date representations, which can be used along with the date format functions
|
||||
(like <function>date</function>).
|
||||
</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>DATE_ATOM</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Atom (example: 2005-08-15T15:52:01+00:00)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>DATE_COOKIE</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
HTTP Cookies (example: Monday, 15-Aug-05 15:52:01 UTC)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>DATE_ISO8601</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
ISO-8601 (example: 2005-08-15T15:52:01+0000)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>DATE_RFC822</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
RFC 822 (example: Mon, 15 Aug 05 15:52:01 +0000)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>DATE_RFC850</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
RFC 850 (example: Monday, 15-Aug-05 15:52:01 UTC)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>DATE_RFC1036</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
RFC 1036 (example: Mon, 15 Aug 05 15:52:01 +0000)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>DATE_RFC1123</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
RFC 1123 (example: Mon, 15 Aug 2005 15:52:01 +0000)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>DATE_RFC2822</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
RFC 2822 (Mon, 15 Aug 2005 15:52:01 +0000)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>DATE_RFC3339</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Same as <constant>DATE_ATOM</constant> (since PHP 5.1.3)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>DATE_RSS</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
RSS (Mon, 15 Aug 2005 15:52:01 +0000)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>DATE_W3C</constant>
|
||||
(<type>string</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
World Wide Web Consortium (example: 2005-08-15T15:52:01+00:00)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
<para>
|
||||
Following constants exists since PHP 5.1.2 and specify a format returned by
|
||||
functions <function>date_sunrise</function> and
|
||||
|
|
67
reference/datetime/dateinterval.xml
Normal file
67
reference/datetime/dateinterval.xml
Normal file
|
@ -0,0 +1,67 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<phpdoc:classref xml:id="class.dateinterval" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>The DateInterval class</title>
|
||||
<titleabbrev>DateInterval</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ DateInterval intro -->
|
||||
<section xml:id="dateinterval.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
Representation of date interval.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<section xml:id="dateinterval.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>DateInterval</classname></ooclass>
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<classname>DateInterval</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
|
||||
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.dateinterval')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
</classsynopsis>
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.datetime.entities.dateinterval;
|
||||
|
||||
</phpdoc:classref>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
58
reference/datetime/dateinterval/construct.xml
Normal file
58
reference/datetime/dateinterval/construct.xml
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="dateinterval.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateInterval::__construct</refname>
|
||||
<refpurpose>Creates new DateInterval object</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<methodname>DateInterval::__construct</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>interval_spec</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Creates new DateInterval object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>interval_spec</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Interval specification.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
65
reference/datetime/dateinterval/createfromdatestring.xml
Normal file
65
reference/datetime/dateinterval/createfromdatestring.xml
Normal file
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="dateinterval.createfromdatestring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateInterval::createFromDateString</refname>
|
||||
<refpurpose>Sets up a DateInterval from the relative parts of the string</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <modifier>static</modifier> <type>DateInterval</type><methodname>DateInterval::createFromDateString</methodname>
|
||||
<methodparam><type>string</type><parameter>time</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Uses the normal date parsers and sets up a DateInterval from the relative parts of the parsed string.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>time</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Date with relative parts.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns new <classname>DateInterval</classname> instance if success.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
54
reference/datetime/dateinterval/format.xml
Normal file
54
reference/datetime/dateinterval/format.xml
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="dateinterval.format" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateInterval::format</refname>
|
||||
<refpurpose>Formats the interval</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>string</type><methodname>DateInterval::format</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Formats the interval.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the formatted interval.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
98
reference/datetime/dateperiod.xml
Normal file
98
reference/datetime/dateperiod.xml
Normal file
|
@ -0,0 +1,98 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<phpdoc:classref xml:id="class.dateperiod" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>The DatePeriod class</title>
|
||||
<titleabbrev>DatePeriod</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ DatePeriod intro -->
|
||||
<section xml:id="dateperiod.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
Representation of date period.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<section xml:id="dateperiod.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>DatePeriod</classname></ooclass>
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<classname>DatePeriod</classname>
|
||||
</ooclass>
|
||||
|
||||
<oointerface>
|
||||
<interfacename>Traversable</interfacename>
|
||||
</oointerface>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
<classsynopsisinfo role="comment">Constants</classsynopsisinfo>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="dateperiod.constants.exclude-start-date">DatePeriod::EXCLUDE_START_DATE</varname>
|
||||
<initializer>1</initializer>
|
||||
</fieldsynopsis>
|
||||
|
||||
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.dateperiod')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
</classsynopsis>
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
<!-- {{{ DatePeriod constants -->
|
||||
<section xml:id="dateperiod.constants">
|
||||
&reftitle.constants;
|
||||
<section xml:id="dateperiod.constants.types">
|
||||
<title>DatePeriod Node Types</title>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry xml:id="dateperiod.constants.exclude-start-date">
|
||||
<term><constant>DatePeriod::EXCLUDE_START_DATE</constant></term>
|
||||
<listitem>
|
||||
<para>Exclude start date, used in <function>DatePeriod::__construct</function>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</section>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.datetime.entities.dateperiod;
|
||||
|
||||
</phpdoc:classref>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
113
reference/datetime/dateperiod/construct.xml
Normal file
113
reference/datetime/dateperiod/construct.xml
Normal file
|
@ -0,0 +1,113 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="dateperiod.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DatePeriod::__construct</refname>
|
||||
<refpurpose>Creates new DatePeriod object</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<methodname>DatePeriod::__construct</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>start</parameter></methodparam>
|
||||
<methodparam><type>DateInterval</type><parameter>interval</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>recurrences</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<methodname>DatePeriod::__construct</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>start</parameter></methodparam>
|
||||
<methodparam><type>DateInterval</type><parameter>interval</parameter></methodparam>
|
||||
<methodparam><type>DateTime</type><parameter>end</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<methodname>DatePeriod::__construct</methodname>
|
||||
<methodparam><type>string</type><parameter>isostr</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Creates new DatePeriod object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>start</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Start date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>interval</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Interval.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>recurrences</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Number of recurrences.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>end</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
End date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>isostr</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
String containing the ISO interval.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>options</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Can be set to <constant>DateTime::EXCLUDE_START_DATE</constant>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
257
reference/datetime/datetime.xml
Normal file
257
reference/datetime/datetime.xml
Normal file
|
@ -0,0 +1,257 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<phpdoc:classref xml:id="class.datetime" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>The DateTime class</title>
|
||||
<titleabbrev>DateTime</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ DateTime intro -->
|
||||
<section xml:id="datetime.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
Representation of date and time.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<section xml:id="datetime.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>DateTime</classname></ooclass>
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<classname>DateTime</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
<classsynopsisinfo role="comment">Constants</classsynopsisinfo>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>string</type>
|
||||
<varname linkend="datetime.constants.atom">DateTime::ATOM</varname>
|
||||
<initializer>Y-m-d\TH:i:sP</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>string</type>
|
||||
<varname linkend="datetime.constants.cookie">DateTime::COOKIE</varname>
|
||||
<initializer>l, d-M-y H:i:s T</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>string</type>
|
||||
<varname linkend="datetime.constants.iso8601">DateTime::ISO8601</varname>
|
||||
<initializer>Y-m-d\TH:i:sO</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>string</type>
|
||||
<varname linkend="datetime.constants.rfc822">DateTime::RFC822</varname>
|
||||
<initializer>D, d M y H:i:s O</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>string</type>
|
||||
<varname linkend="datetime.constants.rfc850">DateTime::RFC850</varname>
|
||||
<initializer>l, d-M-y H:i:s T</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>string</type>
|
||||
<varname linkend="datetime.constants.rfc1036">DateTime::RFC1036</varname>
|
||||
<initializer>D, d M y H:i:s O</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>string</type>
|
||||
<varname linkend="datetime.constants.rfc1123">DateTime::RFC1123</varname>
|
||||
<initializer>D, d M Y H:i:s O</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>string</type>
|
||||
<varname linkend="datetime.constants.rfc2822">DateTime::RFC2822</varname>
|
||||
<initializer>D, d M Y H:i:s O</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>string</type>
|
||||
<varname linkend="datetime.constants.rfc3339">DateTime::RFC3339</varname>
|
||||
<initializer>Y-m-d\TH:i:sP</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>string</type>
|
||||
<varname linkend="datetime.constants.rss">DateTime::RSS</varname>
|
||||
<initializer>D, d M Y H:i:s O</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>string</type>
|
||||
<varname linkend="datetime.constants.w3c">DateTime::W3C</varname>
|
||||
<initializer>Y-m-d\TH:i:sP</initializer>
|
||||
</fieldsynopsis>
|
||||
|
||||
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.datetime')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
</classsynopsis>
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
<!-- {{{ DateTime constants -->
|
||||
<section>
|
||||
&reftitle.constants;
|
||||
<section xml:id="datetime.constants.types">
|
||||
<title>DateTime Node Types</title>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry xml:id="datetime.constants.atom">
|
||||
<term><constant>DateTime::ATOM</constant></term>
|
||||
<term><constant>DATE_ATOM</constant></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Atom (example: 2005-08-15T15:52:01+00:00)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetime.constants.cookie">
|
||||
<term><constant>DateTime::COOKIE</constant></term>
|
||||
<term><constant>DATE_COOKIE</constant></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
HTTP Cookies (example: Monday, 15-Aug-05 15:52:01 UTC)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetime.constants.iso8601">
|
||||
<term><constant>DateTime::ISO8601</constant></term>
|
||||
<term><constant>DATE_ISO8601</constant></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
ISO-8601 (example: 2005-08-15T15:52:01+0000)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetime.constants.rfc822">
|
||||
<term><constant>DateTime::RFC822</constant></term>
|
||||
<term><constant>DATE_RFC822</constant></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
RFC 822 (example: Mon, 15 Aug 05 15:52:01 +0000)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetime.constants.rfc850">
|
||||
<term><constant>DateTime::RFC850</constant></term>
|
||||
<term><constant>DATE_RFC850</constant></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
RFC 850 (example: Monday, 15-Aug-05 15:52:01 UTC)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetime.constants.rfc1036">
|
||||
<term><constant>DateTime::RFC1036</constant></term>
|
||||
<term><constant>DATE_RFC1036</constant></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
RFC 1036 (example: Mon, 15 Aug 05 15:52:01 +0000)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetime.constants.rfc1123">
|
||||
<term><constant>DateTime::RFC1123</constant></term>
|
||||
<term><constant>DATE_RFC1123</constant></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
RFC 1123 (example: Mon, 15 Aug 2005 15:52:01 +0000)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetime.constants.rfc2822">
|
||||
<term><constant>DateTime::RFC2822</constant></term>
|
||||
<term><constant>DATE_RFC2822</constant></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
RFC 2822 (Mon, 15 Aug 2005 15:52:01 +0000)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetime.constants.rfc3339">
|
||||
<term><constant>DateTime::RFC3339</constant></term>
|
||||
<term><constant>DATE_RFC3339</constant></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Same as <constant>DATE_ATOM</constant> (since PHP 5.1.3)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetime.constants.rss">
|
||||
<term><constant>DateTime::RSS</constant></term>
|
||||
<term><constant>DATE_RSS</constant></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
RSS (Mon, 15 Aug 2005 15:52:01 +0000)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetime.constants.w3c">
|
||||
<term><constant>DateTime::W3C</constant></term>
|
||||
<term><constant>DATE_W3C</constant></term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
World Wide Web Consortium (example: 2005-08-15T15:52:01+00:00)
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</section>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.datetime.entities.datetime;
|
||||
|
||||
</phpdoc:classref>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
131
reference/datetime/datetime/add.xml
Normal file
131
reference/datetime/datetime/add.xml
Normal file
|
@ -0,0 +1,131 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.add" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::add</refname>
|
||||
<refpurpose>
|
||||
Adds an amount of days, months, years, hours, minutes and seconds to a
|
||||
DateTime object
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>DateTime::add</methodname>
|
||||
<methodparam><type>string</type><parameter>interval</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_add</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>DateInterval</type><parameter>interval</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Adds the specified <classname>DateInterval</classname> object to the
|
||||
specified <classname>DateTime</classname> object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term>
|
||||
<parameter>interval</parameter>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The amount to be added. For the date use "P3D", "P3M", "P3Y" or a
|
||||
combination of the three e.g. "P2M5D" (Y = Years, M = Months, D = Days.)
|
||||
MUST BE YEAR MONTH DAY FORMAT "P5Y", "P5M2D", "P5Y4D". For the time use
|
||||
"T3H", "T3M", "T3S" or or a combination of the three e.g. "T5H20M" (H =
|
||||
Hours, M = Minutes, S = Seconds). For dateTime use "P5D2M4YT5H20M". The
|
||||
digit before the letter (NOT P or T) can be any amount.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>date_add</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$date = new DateTime("18-July-2008 16:30:30");
|
||||
echo $date->format("d-m-Y H:i:s").'<br />';
|
||||
|
||||
date_add($date, new DateInterval("P5D"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Days';
|
||||
|
||||
date_add($date, new DateInterval("P5M"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Months';
|
||||
|
||||
date_add($date, new DateInterval("P5Y"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Years';
|
||||
|
||||
date_add($date, new DateInterval("P5Y5M5D"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Days, 5 Months, 5 Years';
|
||||
|
||||
date_add($date, new DateInterval("P5YT5H"));
|
||||
echo '<br />'.$date->format("d-m-Y H:i:s").' : 5 Years, 5 Hours';
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
&warn.experimental.func;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>DateTime::sub</function></member>
|
||||
<member><function>DateTime::diff</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
94
reference/datetime/datetime/construct.xml
Normal file
94
reference/datetime/datetime/construct.xml
Normal file
|
@ -0,0 +1,94 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::__construct</refname>
|
||||
<refpurpose>Returns new DateTime object</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<methodname>DateTime::__construct</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>time</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>DateTimeZone</type><parameter>timezone</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns new DateTime object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>time</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
String in a format accepted by <function>strtotime</function>, defaults
|
||||
to "now".
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>timezone</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Time zone of the time.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<para>
|
||||
Emits <classname>Exception</classname> in case of an error.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>DateTime::__construct</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime('2008-08-03 14:52:10');
|
||||
echo $datetime->format(DATE_ATOM);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
83
reference/datetime/datetime/createfromformat.xml
Normal file
83
reference/datetime/datetime/createfromformat.xml
Normal file
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.createfromformat" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::createFromFormat</refname>
|
||||
<refpurpose>Returns new DateTime object formatted according to the specified format</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <modifier>static</modifier> <type>DateTime</type><methodname>DateTime::createFromFormat</methodname>
|
||||
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>time</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>DateTimeZone</type><parameter>timezone</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns new DateTime object formatted according to the specified format.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>format</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Format accepted by <function>date</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>time</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
String represeting the time.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>timezone</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Time zone.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns new DateTime instance.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
74
reference/datetime/datetime/diff.xml
Normal file
74
reference/datetime/datetime/diff.xml
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.diff" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::diff</refname>
|
||||
<refpurpose>Returns the difference between two DateTime objects</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>DateInterval</type><methodname>DateTime::diff</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>datetime</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>absolute</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns the difference between two DateTime objects.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>datetime</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The date to compare to.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>absolute</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Whether to return absolute difference. Defaults to &false;.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
The difference between to dates.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
121
reference/datetime/datetime/format.xml
Normal file
121
reference/datetime/datetime/format.xml
Normal file
|
@ -0,0 +1,121 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.format" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::format</refname>
|
||||
<refpurpose>Returns date formatted according to given format</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>string</type><methodname>DateTime::format</methodname>
|
||||
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>date_format</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>format</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Format accepted by <function>date</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns formatted date on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Displaying the date and time using the procedural form</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = date_create('2008-08-03 14:52:10');
|
||||
echo date_format($datetime, 'jS, F Y') . "\n";
|
||||
echo date_format($datetime, DATE_ATOM);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Displaying the date and time using the object oriented form</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime('2008-08-03 14:52:10');
|
||||
echo $datetime->format('jS, F Y') . "\n";
|
||||
echo $datetime->format(DATE_ATOM);
|
||||
?>
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
3rd, August 2008
|
||||
2008-08-03T14:52:10+01:00
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>date</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
91
reference/datetime/datetime/getlasterrors.xml
Normal file
91
reference/datetime/datetime/getlasterrors.xml
Normal file
|
@ -0,0 +1,91 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.getlasterrors" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::getLastErrors</refname>
|
||||
<refpurpose>Returns the warnings and errors</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <modifier>static</modifier> <type>array</type><methodname>DateTime::getLastErrors</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns the warnings and errors found while parsing a date/time string.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns array containing info about warnings and errors.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>DateTime::getLastErrors</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$date = date_create('asdfasdf');
|
||||
print_r(DateTime::getLastErrors());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[warning_count] => 1
|
||||
[warnings] => Array
|
||||
(
|
||||
[6] => Double timezone specification
|
||||
)
|
||||
|
||||
[error_count] => 1
|
||||
[errors] => Array
|
||||
(
|
||||
[0] => The timezone could not be found in the database
|
||||
)
|
||||
|
||||
)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
80
reference/datetime/datetime/getoffset.xml
Normal file
80
reference/datetime/datetime/getoffset.xml
Normal file
|
@ -0,0 +1,80 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.getoffset" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::getOffset</refname>
|
||||
<refpurpose>Returns the daylight saving time offset</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>DateTime::getOffset</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>date_offset_get</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns DST offset in seconds on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Comparing offsets between Summer and Winter</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$winter = new DateTime('2008-12-25 14:25:41');
|
||||
$summer = new DateTime('2008-07-14 14:25:41');
|
||||
|
||||
echo $winter->getOffset(); // Winter offset: 0
|
||||
echo $summer->getOffset(); // Summer offset: 3600 = 1 hour
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
63
reference/datetime/datetime/gettimestamp.xml
Normal file
63
reference/datetime/datetime/gettimestamp.xml
Normal file
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.gettimestamp" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::getTimestamp</refname>
|
||||
<refpurpose>Gets the Unix timestamp</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>int</type><methodname>DateTime::getTimestamp</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Gets the Unix timestamp.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns Unix timestamp representing the date.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><methodname>DateTime::setTimestamp</methodname></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
99
reference/datetime/datetime/gettimezone.xml
Normal file
99
reference/datetime/datetime/gettimezone.xml
Normal file
|
@ -0,0 +1,99 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.gettimezone" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::getTimezone</refname>
|
||||
<refpurpose>Return time zone relative to given DateTime</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>DateTimeZone</type><methodname>DateTime::getTimezone</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>DateTimeZone</type><methodname>date_timezone_get</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns DateTimeZone object on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Setting and getting DateTimeZone objects</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime('2008-08-03 12:35:23');
|
||||
echo $datetime->getTimezone()->getName() . "\n";
|
||||
|
||||
$datetime = new DateTime('2008-08-03 12:35:23');
|
||||
$la_time = new DateTimeZone('America/Los_Angeles');
|
||||
$datetime->setTimezone($la_time);
|
||||
echo $datetime->getTimezone()->getName();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Europe/London
|
||||
America/Los_Angeles
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>DateTime::timezone_set</function></member>
|
||||
<member><function>timezone_open</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
104
reference/datetime/datetime/modify.xml
Normal file
104
reference/datetime/datetime/modify.xml
Normal file
|
@ -0,0 +1,104 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.modify" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::modify</refname>
|
||||
<refpurpose>Alters the timestamp</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>DateTime::modify</methodname>
|
||||
<methodparam><type>string</type><parameter>modify</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_modify</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>modify</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Alter the timestamp of a DateTime object by incrementing or decrementing in a
|
||||
format accepted by <function>strtotime</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>modify</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
String in a relative format accepted by <function>strtotime</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &null; on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>date_modify</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$date = new DateTime("2006-12-12");
|
||||
$date->modify("+1 day");
|
||||
echo $date->format("Y-m-d");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
2006-12-13
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>strtotime</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
54
reference/datetime/datetime/set-state.xml
Normal file
54
reference/datetime/datetime/set-state.xml
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.set-state" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::__set_state</refname>
|
||||
<refpurpose>The __set_state handler</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <modifier>static</modifier> <type>DateTime</type><methodname>DateTime::__set_state</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <link linkend="language.oop5.magic.set-state">__set_state</link> handler.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns a new instance of a DateTime object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
144
reference/datetime/datetime/setdate.xml
Normal file
144
reference/datetime/datetime/setdate.xml
Normal file
|
@ -0,0 +1,144 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.setdate" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::setDate</refname>
|
||||
<refpurpose>Sets the date</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>DateTime::setDate</methodname>
|
||||
<methodparam><type>int</type><parameter>year</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>month</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>day</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_date_set</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>year</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>month</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>day</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Resets the current date of the DateTime object to a different date.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>year</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Year of the date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>month</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Month of the date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>day</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Day of the date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &null; on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Object oriented example usage</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime('2008-08-03 14:52:10');
|
||||
$datetime->setDate(2008, 10, 12);
|
||||
|
||||
echo $datetime->format(DATE_RFC2822);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Procedural example usage</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = date_create('2008-08-03 14:52:10');
|
||||
date_date_set($datetime, 2008, 10, 12);
|
||||
|
||||
echo date_format($datetime, DATE_RFC2822);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Sun, 12 Oct 2008 14:52:10 +0100
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>DateTime::setISODate</function></member>
|
||||
<member><function>DateTime::setTime</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
139
reference/datetime/datetime/setisodate.xml
Normal file
139
reference/datetime/datetime/setisodate.xml
Normal file
|
@ -0,0 +1,139 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.setisodate" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::setISODate</refname>
|
||||
<refpurpose>Sets the ISO date</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>DateTime::setISODate</methodname>
|
||||
<methodparam><type>int</type><parameter>year</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>week</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>day</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_isodate_set</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>year</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>week</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>day</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Set a date according to the ISO 8601 standard - using weeks and day offsets
|
||||
rather than specific dates.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>year</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Year of the date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>week</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Week of the date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>day</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Offset from the first day of the week.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &null; on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Finding the date from a week number and day offset</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime();
|
||||
|
||||
// Offset from start of week 2 (7) = 5
|
||||
$datetime->setISODate(2008, 2, 5); // Day 5 of week 2 of 2008 is the 11th of January.
|
||||
|
||||
// Offset from start of week 2 (7) = 10
|
||||
$datetime->setISODate(2008, 2, 10); // Day 10 of week 2 of 2008 is the 16th of January.
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Finding the month a week is in</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = date_create();
|
||||
date_isodate_set($datetime, 2008, 6); // Week 6 of 2008 is in February.
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>DateTime::setDate</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
139
reference/datetime/datetime/settime.xml
Normal file
139
reference/datetime/datetime/settime.xml
Normal file
|
@ -0,0 +1,139 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.settime" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::setTime</refname>
|
||||
<refpurpose>Sets the time</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>DateTime::setTime</methodname>
|
||||
<methodparam><type>int</type><parameter>hour</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>minute</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>second</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_time_set</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>hour</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>minute</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>second</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Resets the current time of the DateTime object to a different time.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>hour</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Hour of the time.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>minute</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Minute of the time.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>second</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Second of the time.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &null; on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Changing the time of a DateTime object</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime('2008-08-03 12:35:23');
|
||||
echo $datetime->format('Y-m-d H:i:s') . "\n";
|
||||
|
||||
$datetime->setTime(14, 55, 24);
|
||||
echo $datetime->format('Y-m-d H:i:s') . "\n";
|
||||
|
||||
// Warning: Does not increment the hour!
|
||||
// This is because the hour has been set (14) - see date_modify()
|
||||
$datetime->setTime($datetime->format('H'), $datetime->format('n') + 6);
|
||||
echo $datetime->format('Y-m-d H:i:s') . "\n";
|
||||
|
||||
// *Does* increment the day, because the day has not been set
|
||||
$datetime->setTime($datetime->format('H') + 12, $datetime->format('n'));
|
||||
echo $datetime->format('Y-m-d H:i:s') . "\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
2008-08-03 12:35:23
|
||||
2008-08-03 14:55:24
|
||||
2008-08-03 14:14:00
|
||||
2008-08-04 02:08:00
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>DateTime::setDate</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
74
reference/datetime/datetime/settimestamp.xml
Normal file
74
reference/datetime/datetime/settimestamp.xml
Normal file
|
@ -0,0 +1,74 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.settimestamp" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::setTimestamp</refname>
|
||||
<refpurpose>Sets the date and time based on an Unix timestamp</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>DateTime</type><methodname>DateTime::setTimestamp</methodname>
|
||||
<methodparam><type>int</type><parameter>unixtimestamp</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Sets the date and time based on an Unix timestamp.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>unixtimestamp</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Unix timestamp representing the date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns the modified DateTime.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><methodname>DateTime::getTimestamp</methodname></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
108
reference/datetime/datetime/settimezone.xml
Normal file
108
reference/datetime/datetime/settimezone.xml
Normal file
|
@ -0,0 +1,108 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.settimezone" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::setTimezone</refname>
|
||||
<refpurpose>Sets the time zone for the DateTime object</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>DateTime::setTimezone</methodname>
|
||||
<methodparam><type>DateTimeZone</type><parameter>timezone</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_timezone_set</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>DateTimeZone</type><parameter>timezone</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>timezone</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Desired time zone.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &null; on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Setting and getting DateTimeZone objects</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime('2008-08-03 12:35:23');
|
||||
echo $datetime->getTimezone()->getName() . "\n";
|
||||
|
||||
$datetime = new DateTime('2008-08-03 12:35:23');
|
||||
$la_time = new DateTimeZone('America/Los_Angeles');
|
||||
$datetime->setTimezone($la_time);
|
||||
echo $datetime->getTimezone()->getName();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Europe/London
|
||||
America/Los_Angeles
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>DateTime::getTimezone</function></member>
|
||||
<member><function>timezone_open</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
131
reference/datetime/datetime/sub.xml
Normal file
131
reference/datetime/datetime/sub.xml
Normal file
|
@ -0,0 +1,131 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.sub" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::sub</refname>
|
||||
<refpurpose>
|
||||
Subtracts an amount of days, months, years, hours, minutes and seconds from
|
||||
a DateTime object
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>void</type><methodname>DateTime::sub</methodname>
|
||||
<methodparam><type>DateInterval</type><parameter>interval</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_sub</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>DateInterval</type><parameter>interval</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Subtracts the specified <classname>DateInterval</classname> object from the specified DateTime
|
||||
object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term>
|
||||
<parameter>interval</parameter>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The amount to be subtracted. For the date use "P3D", "P3M", "P3Y" or a
|
||||
combination of the three e.g. "P2M5D" (Y = Years, M = Months, D = Days.)
|
||||
MUST BE YEAR MONTH DAY FORMAT "P5Y", "P5M2D", "P5Y4D". For the time use
|
||||
"T3H", "T3M", "T3S" or or a combination of the three e.g. "T5H20M" (H =
|
||||
Hours, M = Minutes, S = Seconds). For dateTime us "P5D2M4YT5H20M". The
|
||||
digit before the letter (NOT P or T) can be any amount.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>date_sub</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$date = new DateTime("18-July-2008 16:30:30");
|
||||
echo $date->format("d-m-Y H:i:s").'<br />';
|
||||
|
||||
date_sub($date, new DateInterval("P5D"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Days';
|
||||
|
||||
date_sub($date, new DateInterval("P5M"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Months';
|
||||
|
||||
date_sub($date, new DateInterval("P5Y"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Years';
|
||||
|
||||
date_sub($date, new DateInterval("P5Y5M5D"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Days, 5 Months, 5 Years';
|
||||
|
||||
date_sub($date, new DateInterval("P5YT5H"));
|
||||
echo '<br />'.$date->format("d-m-Y H:i:s").' : 5 Years, 5 Hours';
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
&warn.experimental.func;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>DateTime::add</function></member>
|
||||
<member><function>DateTime::diff</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
54
reference/datetime/datetime/wakeup.xml
Normal file
54
reference/datetime/datetime/wakeup.xml
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetime.wakeup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTime::__wakeup</refname>
|
||||
<refpurpose>The __wakeup handler</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>DateTime</type><methodname>DateTime::__wakeup</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <link linkend="language.oop5.magic.sleep">__wakeup</link> handler.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Initializes a DateTime object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
263
reference/datetime/datetimezone.xml
Normal file
263
reference/datetime/datetimezone.xml
Normal file
|
@ -0,0 +1,263 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<phpdoc:classref xml:id="class.datetimezone" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
|
||||
<title>The DateTimeZone class</title>
|
||||
<titleabbrev>DateTimeZone</titleabbrev>
|
||||
|
||||
<partintro>
|
||||
|
||||
<!-- {{{ DateTimeZone intro -->
|
||||
<section xml:id="datetimezone.intro">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
Representation of time zone.
|
||||
</para>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
<section xml:id="datetimezone.synopsis">
|
||||
&reftitle.classsynopsis;
|
||||
|
||||
<!-- {{{ Synopsis -->
|
||||
<classsynopsis>
|
||||
<ooclass><classname>DateTimeZone</classname></ooclass>
|
||||
|
||||
<!-- {{{ Class synopsis -->
|
||||
<classsynopsisinfo>
|
||||
<ooclass>
|
||||
<classname>DateTimeZone</classname>
|
||||
</ooclass>
|
||||
</classsynopsisinfo>
|
||||
<!-- }}} -->
|
||||
<classsynopsisinfo role="comment">Constants</classsynopsisinfo>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.africa">DateTimeZone::AFRICA</varname>
|
||||
<initializer>1</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.america">DateTimeZone::AMERICA</varname>
|
||||
<initializer>2</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.antarctica">DateTimeZone::ANTARCTICA</varname>
|
||||
<initializer>4</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.arctic">DateTimeZone::ARCTIC</varname>
|
||||
<initializer>8</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.asia">DateTimeZone::ASIA</varname>
|
||||
<initializer>16</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.atlantic">DateTimeZone::ATLANTIC</varname>
|
||||
<initializer>32</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.australia">DateTimeZone::AUSTRALIA</varname>
|
||||
<initializer>64</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.europe">DateTimeZone::EUROPE</varname>
|
||||
<initializer>128</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.indian">DateTimeZone::INDIAN</varname>
|
||||
<initializer>256</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.pacific">DateTimeZone::PACIFIC</varname>
|
||||
<initializer>512</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.utc">DateTimeZone::UTC</varname>
|
||||
<initializer>1024</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.all">DateTimeZone::ALL</varname>
|
||||
<initializer>2047</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.all-with-bc">DateTimeZone::ALL_WITH_BC</varname>
|
||||
<initializer>4095</initializer>
|
||||
</fieldsynopsis>
|
||||
<fieldsynopsis>
|
||||
<modifier>const</modifier>
|
||||
<type>integer</type>
|
||||
<varname linkend="datetimezone.constants.per-country">DateTimeZone::PER_COUNTRY</varname>
|
||||
<initializer>4096</initializer>
|
||||
</fieldsynopsis>
|
||||
|
||||
<classsynopsisinfo role="comment">Methods</classsynopsisinfo>
|
||||
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.datetimezone')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" />
|
||||
</classsynopsis>
|
||||
<!-- }}} -->
|
||||
|
||||
</section>
|
||||
|
||||
<!-- {{{ DateTimeZone constants -->
|
||||
<section xml:id="datetimezone.constants">
|
||||
&reftitle.constants;
|
||||
<section xml:id="datetimezone.constants.types">
|
||||
<title>DateTimeZone Node Types</title>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.africa">
|
||||
<term><constant>DateTimeZone::AFRICA</constant></term>
|
||||
<listitem>
|
||||
<para>Africa time zones.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.america">
|
||||
<term><constant>DateTimeZone::AMERICA</constant></term>
|
||||
<listitem>
|
||||
<para>America time zones.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.antarctica">
|
||||
<term><constant>DateTimeZone::ANTARCTICA</constant></term>
|
||||
<listitem>
|
||||
<para>Antarctica time zones.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.arctic">
|
||||
<term><constant>DateTimeZone::ARCTIC</constant></term>
|
||||
<listitem>
|
||||
<para>Artic time zones.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.asia">
|
||||
<term><constant>DateTimeZone::ASIA</constant></term>
|
||||
<listitem>
|
||||
<para>Asia time zones.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.atlantic">
|
||||
<term><constant>DateTimeZone::ATLANTIC</constant></term>
|
||||
<listitem>
|
||||
<para>Atlantic time zones.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.australia">
|
||||
<term><constant>DateTimeZone::AUSTRALIA</constant></term>
|
||||
<listitem>
|
||||
<para>Australia time zones.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.europe">
|
||||
<term><constant>DateTimeZone::EUROPE</constant></term>
|
||||
<listitem>
|
||||
<para>Europe time zones.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.indian">
|
||||
<term><constant>DateTimeZone::INDIAN</constant></term>
|
||||
<listitem>
|
||||
<para>Indian time zones.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.pacific">
|
||||
<term><constant>DateTimeZone::PACIFIC</constant></term>
|
||||
<listitem>
|
||||
<para>Pacific time zones.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.utc">
|
||||
<term><constant>DateTimeZone::UTC</constant></term>
|
||||
<listitem>
|
||||
<para>UTC time zones.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.all">
|
||||
<term><constant>DateTimeZone::ALL</constant></term>
|
||||
<listitem>
|
||||
<para>All time zones.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.all-with-bc">
|
||||
<term><constant>DateTimeZone::ALL_WITH_BC</constant></term>
|
||||
<listitem>
|
||||
<para>All time zones including backwards compatible.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry xml:id="datetimezone.constants.per-country">
|
||||
<term><constant>DateTimeZone::PER_COUNTRY</constant></term>
|
||||
<listitem>
|
||||
<para>Time zones per country.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</section>
|
||||
</section>
|
||||
<!-- }}} -->
|
||||
|
||||
|
||||
</partintro>
|
||||
|
||||
&reference.datetime.entities.datetimezone;
|
||||
|
||||
</phpdoc:classref>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
58
reference/datetime/datetimezone/construct.xml
Normal file
58
reference/datetime/datetimezone/construct.xml
Normal file
|
@ -0,0 +1,58 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetimezone.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTimeZone::__construct</refname>
|
||||
<refpurpose>Creates new DateTimeZone object</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<methodname>DateTimeZone::__construct</methodname>
|
||||
<methodparam><type>string</type><parameter>timezone</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Creates new DateTimeZone object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>timezone</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
One of <link linkend="timezones">timezones</link>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
83
reference/datetime/datetimezone/getlocation.xml
Normal file
83
reference/datetime/datetimezone/getlocation.xml
Normal file
|
@ -0,0 +1,83 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetimezone.getlocation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTimeZone::getLocation</refname>
|
||||
<refpurpose>Returns location information for a timezone</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>array</type><methodname>DateTimeZone::getLocation</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns location information for a timezone, including country code, latitude/longitude and comments.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Array containing location information about timezone.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>DateTimeZone::getLocation</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$tz = new DateTimeZone("Europe/Prague");
|
||||
print_r($tz->getLocation());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[country_code] => CZ
|
||||
[latitude] => 50.08333
|
||||
[longitude] => 14.43333
|
||||
[comments] =>
|
||||
)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
54
reference/datetime/datetimezone/getname.xml
Normal file
54
reference/datetime/datetimezone/getname.xml
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetimezone.getname" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTimeZone::getName</refname>
|
||||
<refpurpose>Returns the name of the timezone</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<modifier>public</modifier> <type>string</type><methodname>DateTimeZone::getName</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns the name of the timezone.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
One of <link linkend="timezones">timezones</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
104
reference/datetime/datetimezone/getoffset.xml
Normal file
104
reference/datetime/datetimezone/getoffset.xml
Normal file
|
@ -0,0 +1,104 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetimezone.getoffset" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTimeZone::getOffset</refname>
|
||||
<refpurpose>Returns the timezone offset from GMT</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>DateTimeZone::getOffset</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>datetime</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>timezone_offset_get</methodname>
|
||||
<methodparam><type>DateTimeZone</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>DateTime</type><parameter>datetime</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function returns the offset to GMT for the date/time specified in the
|
||||
<parameter>datetime</parameter> parameter. The GMT offset is calculated
|
||||
with the timezone information contained in the DateTime object being used.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetimezone.description;
|
||||
<varlistentry>
|
||||
<term><parameter>datetime</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
DateTime that contains the date/time to compute the offset from.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns time zone offset in seconds on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>timezone_offset_get</function> examples</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Create two timezone objects, one for Taipei (Taiwan) and one for
|
||||
// Tokyo (Japan)
|
||||
$dateTimeZoneTaipei = new DateTimeZone("Asia/Taipei");
|
||||
$dateTimeZoneJapan = new DateTimeZone("Asia/Tokyo");
|
||||
|
||||
// Create two DateTime objects that will contain the same Unix timestamp, but
|
||||
// have different timezones attached to them.
|
||||
$dateTimeTaipei = new DateTime("now", $dateTimeZoneTaipei);
|
||||
$dateTimeJapan = new DateTime("now", $dateTimeZoneJapan);
|
||||
|
||||
// Calculate the GMT offset for the date/time contained in the $dateTimeTaipei
|
||||
// object, but using the timezone rules as defined for Tokyo
|
||||
// ($dateTimeZoneJapan).
|
||||
$timeOffset = $dateTimeZoneJapan->getOffset($dateTimeTaipei);
|
||||
|
||||
// Should show int(32400) (for dates after Sat Sep 8 01:00:00 1951 JST).
|
||||
var_dump($timeOffset);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
108
reference/datetime/datetimezone/gettransitions.xml
Normal file
108
reference/datetime/datetimezone/gettransitions.xml
Normal file
|
@ -0,0 +1,108 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetimezone.gettransitions" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTimeZone::getTransitions</refname>
|
||||
<refpurpose>Returns all transitions for the timezone</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>DateTimeZone::getTransitions</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>timestamp_begin</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>timestamp_end</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>timezone_transitions_get</methodname>
|
||||
<methodparam><type>DateTimeZone</type><parameter>object</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>timestamp_begin</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>timestamp_end</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetimezone.description;
|
||||
<varlistentry>
|
||||
<term><parameter>timestamp_begin</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Begin timestamp.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>timestamp_end</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
End timestamp.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns numerically indexed array containing associative array with all
|
||||
transitions on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>timezone_transitions_get</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$timezone = new DateTimeZone("CET");
|
||||
print_r(reset($timezone->getTransitions()));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[ts] => -1693706400
|
||||
[time] => 1916-04-30T22:00:00+0000
|
||||
[offset] => 7200
|
||||
[isdst] => 1
|
||||
[abbr] => CEST
|
||||
)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
111
reference/datetime/datetimezone/listabbreviations.xml
Normal file
111
reference/datetime/datetimezone/listabbreviations.xml
Normal file
|
@ -0,0 +1,111 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetimezone.listabbreviations" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTimeZone::listAbbreviations</refname>
|
||||
<refpurpose>Returns associative array containing dst, offset and the timezone name</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>DateTimeZone::listAbbreviations</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>timezone_abbreviations_list</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns array on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>timezone_abbreviations_list</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$timezone_abbreviations = DateTimeZone::listAbbreviations();
|
||||
print_r($timezone_abbreviations["acst"]);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[dst] => 1
|
||||
[offset] => -14400
|
||||
[timezone_id] => America/Porto_Acre
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[dst] => 1
|
||||
[offset] => -14400
|
||||
[timezone_id] => America/Eirunepe
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[dst] => 1
|
||||
[offset] => -14400
|
||||
[timezone_id] => America/Rio_Branco
|
||||
)
|
||||
|
||||
[3] => Array
|
||||
(
|
||||
[dst] => 1
|
||||
[offset] => -14400
|
||||
[timezone_id] => Brazil/Acre
|
||||
)
|
||||
|
||||
)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>timezone_identifiers_list</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
115
reference/datetime/datetimezone/listidentifiers.xml
Normal file
115
reference/datetime/datetimezone/listidentifiers.xml
Normal file
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="datetimezone.listidentifiers" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>DateTimeZone::listIdentifiers</refname>
|
||||
<refpurpose>Returns numerically index array with all timezone identifiers</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>DateTimeZone::listIdentifiers</methodname>
|
||||
<methodparam><type>int</type><parameter>what</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>country</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>timezone_identifiers_list</methodname>
|
||||
<methodparam><type>int</type><parameter>what</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>option</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>what</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
One of <classname>DateTimeZone</classname> class constants, defaults to
|
||||
<constant>DateTimeZone::ALL</constant>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>country</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A two-letter ISO 3166-1 compatible country code.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns array on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>timezone_identifiers_list</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$timezone_identifiers = DateTimeZone::listIdentifiers();
|
||||
for ($i=0; $i < 5; $i++) {
|
||||
echo "$timezone_identifiers[$i]\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Africa/Abidjan
|
||||
Africa/Accra
|
||||
Africa/Addis_Ababa
|
||||
Africa/Algiers
|
||||
Africa/Asmera
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>timezone_abbreviations_list</function></member>
|
||||
</simplelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,104 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- $Revision: 1.9 $ -->
|
||||
<refentry xml:id="function.date-add" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>date_add</refname>
|
||||
<refpurpose>
|
||||
Adds an amount of days, months, years, hours, minutes and seconds to a
|
||||
DateTime object
|
||||
</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTime::add</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_add</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>DateInterval</type><parameter>interval</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Adds the specified <classname>DateInterval</classname> object to the
|
||||
specified <classname>DateTime</classname> object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term>
|
||||
<parameter>interval</parameter>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The amount to be added. For the date use "P3D", "P3M", "P3Y" or a
|
||||
combination of the three e.g. "P2M5D" (Y = Years, M = Months, D = Days.)
|
||||
MUST BE YEAR MONTH DAY FORMAT "P5Y", "P5M2D", "P5Y4D". For the time use
|
||||
"T3H", "T3M", "T3S" or or a combination of the three e.g. "T5H20M" (H =
|
||||
Hours, M = Minutes, S = Seconds). For dateTime use "P5D2M4YT5H20M". The
|
||||
digit before the letter (NOT P or T) can be any amount.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>date_add</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$date = new DateTime("18-July-2008 16:30:30");
|
||||
echo $date->format("d-m-Y H:i:s").'<br />';
|
||||
|
||||
date_add($date, new DateInterval("P5D"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Days';
|
||||
|
||||
date_add($date, new DateInterval("P5M"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Months';
|
||||
|
||||
date_add($date, new DateInterval("P5Y"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Years';
|
||||
|
||||
date_add($date, new DateInterval("P5Y5M5D"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Days, 5 Months, 5 Years';
|
||||
|
||||
date_add($date, new DateInterval("P5YT5H"));
|
||||
echo '<br />'.$date->format("d-m-Y H:i:s").' : 5 Years, 5 Hours';
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
&warn.experimental.func;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>date_sub</function></member>
|
||||
<member><function>date_diff</function></member>
|
||||
</simplelist>
|
||||
&info.function.alias; <methodname>DateTime::add</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
38
reference/datetime/functions/date-create-from-format.xml
Normal file
38
reference/datetime/functions/date-create-from-format.xml
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="function.date-create-from-format" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>date_create_from_format</refname>
|
||||
<refpurpose>&Alias; <methodname>DateTime::createFromFormat</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<para>
|
||||
&info.function.alias; <methodname>DateTime::createFromFormat</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<refentry xml:id="function.date-create" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>date_create</refname>
|
||||
|
@ -13,11 +13,6 @@
|
|||
<methodparam choice="opt"><type>string</type><parameter>time</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>DateTimeZone</type><parameter>timezone</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>DateTime</type><methodname>DateTime::__construct</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>time</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>DateTimeZone</type><parameter>timezone</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
|
@ -56,22 +51,7 @@
|
|||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Object oriented style</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime('2008-08-03 14:52:10');
|
||||
echo $datetime->format(DATE_ATOM);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Procedural style</title>
|
||||
<title><function>date_create</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
|
|
@ -1,121 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry xml:id="function.date-date-set" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>date_date_set</refname>
|
||||
<refpurpose>Sets the date</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTime::setDate</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_date_set</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>year</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>month</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>day</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>DateTime::setDate</methodname>
|
||||
<methodparam><type>int</type><parameter>year</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>month</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>day</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Resets the current date of the DateTime object to a different date.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>year</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Year of the date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>month</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Month of the date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>day</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Day of the date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &null; on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Object oriented example usage</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime('2008-08-03 14:52:10');
|
||||
$datetime->setDate(2008, 10, 12);
|
||||
|
||||
echo $datetime->format(DATE_RFC2822);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Procedural example usage</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = date_create('2008-08-03 14:52:10');
|
||||
date_date_set($datetime, 2008, 10, 12);
|
||||
|
||||
echo date_format($datetime, DATE_RFC2822);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Sun, 12 Oct 2008 14:52:10 +0100
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>date_isodate_set</function></member>
|
||||
<member><function>date_time_set</function></member>
|
||||
</simplelist>
|
||||
&info.function.alias; <methodname>DateTime::setDate</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
38
reference/datetime/functions/date-diff.xml
Normal file
38
reference/datetime/functions/date-diff.xml
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="function.date-diff" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>date_diff</refname>
|
||||
<refpurpose>&Alias; <methodname>DateTime::diff</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<para>
|
||||
&info.function.alias; <methodname>DateTime::diff</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,97 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<refentry xml:id="function.date-format" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>date_format</refname>
|
||||
<refpurpose>Returns date formatted according to given format</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTime::format</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>date_format</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>DateTime::format</methodname>
|
||||
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>format</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Format accepted by <function>date</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns formatted date on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Displaying the date and time using the procedural form</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = date_create('2008-08-03 14:52:10');
|
||||
echo date_format($datetime, 'jS, F Y') . "\n";
|
||||
echo date_format($datetime, DATE_ATOM);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Displaying the date and time using the object oriented form</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime('2008-08-03 14:52:10');
|
||||
echo $datetime->format('jS, F Y') . "\n";
|
||||
echo $datetime->format(DATE_ATOM);
|
||||
?>
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
3rd, August 2008
|
||||
2008-08-03T14:52:10+01:00
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>date</function></member>
|
||||
</simplelist>
|
||||
&info.function.alias; <methodname>DateTime::format</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
38
reference/datetime/functions/date-get-last-errors.xml
Normal file
38
reference/datetime/functions/date-get-last-errors.xml
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="function.date-get-last-errors" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>date_get_last_errors</refname>
|
||||
<refpurpose>&Alias; <methodname>DateTime::getLastErrors</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<para>
|
||||
&info.function.alias; <methodname>DateTime::getLastErrors</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="function.date-interval-create-from-date-string" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>date_interval_create_from_date_string</refname>
|
||||
<refpurpose>&Alias; <methodname>DateInterval::createFromDateString</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<para>
|
||||
&info.function.alias; <methodname>DateInterval::createFromDateString</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
38
reference/datetime/functions/date-interval-format.xml
Normal file
38
reference/datetime/functions/date-interval-format.xml
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="function.date-interval-format" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>date_interval_format</refname>
|
||||
<refpurpose>&Alias; <methodname>DateInterval::format</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<para>
|
||||
&info.function.alias; <methodname>DateInterval::format</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,116 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry xml:id="function.date-isodate-set" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>date_isodate_set</refname>
|
||||
<refpurpose>Sets the ISO date</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTime::setISODate</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_isodate_set</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>year</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>week</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>day</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>DateTime::setISODate</methodname>
|
||||
<methodparam><type>int</type><parameter>year</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>week</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>day</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Set a date according to the ISO 8601 standard - using weeks and day offsets
|
||||
rather than specific dates.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>year</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Year of the date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>week</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Week of the date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>day</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Offset from the first day of the week.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &null; on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Finding the date from a week number and day offset</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime();
|
||||
|
||||
// Offset from start of week 2 (7) = 5
|
||||
$datetime->setISODate(2008, 2, 5); // Day 5 of week 2 of 2008 is the 11th of January.
|
||||
|
||||
// Offset from start of week 2 (7) = 10
|
||||
$datetime->setISODate(2008, 2, 10); // Day 10 of week 2 of 2008 is the 16th of January.
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example>
|
||||
<title>Finding the month a week is in</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = date_create();
|
||||
date_isodate_set($datetime, 2008, 6); // Week 6 of 2008 is in February.
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>date_date_set</function></member>
|
||||
</simplelist>
|
||||
&info.function.alias; <methodname>DateTime::setISODate</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
|
@ -1,81 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<refentry xml:id="function.date-modify" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>date_modify</refname>
|
||||
<refpurpose>Alters the timestamp</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTime::modify</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_modify</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>modify</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>DateTime::modify</methodname>
|
||||
<methodparam><type>string</type><parameter>modify</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Alter the timestamp of a DateTime object by incrementing or decrementing in a
|
||||
format accepted by <function>strtotime</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>modify</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
String in a relative format accepted by <function>strtotime</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &null; on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>date_modify</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$date = new DateTime("2006-12-12");
|
||||
$date->modify("+1 day");
|
||||
echo $date->format("Y-m-d");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
2006-12-13
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>strtotime</function></member>
|
||||
</simplelist>
|
||||
&info.function.alias; <methodname>DateTime::modify</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
|
@ -1,57 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<refentry xml:id="function.date-offset-get" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>date_offset_get</refname>
|
||||
<refpurpose>Returns the daylight saving time offset</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTime::getOffset</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>date_offset_get</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>DateTime::getOffset</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns DST offset in seconds on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Comparing offsets between Summer and Winter</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$winter = new DateTime('2008-12-25 14:25:41');
|
||||
$summer = new DateTime('2008-07-14 14:25:41');
|
||||
|
||||
echo $winter->getOffset(); // Winter offset: 0
|
||||
echo $summer->getOffset(); // Summer offset: 3600 = 1 hour
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
&info.function.alias; <methodname>DateTime::getOffset</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
121
reference/datetime/functions/date-parse-from-format.xml
Normal file
121
reference/datetime/functions/date-parse-from-format.xml
Normal file
|
@ -0,0 +1,121 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="function.date-parse-from-format" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>date_parse_from_format</refname>
|
||||
<refpurpose>Get info about given date</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>date_parse_from_format</methodname>
|
||||
<methodparam><type>string</type><parameter>format</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>date</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Returns associative array with detailed info about given date.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>format</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Format accepted by <function>date</function> with some extras.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>date</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
String representing the date.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<!-- See also &return.success; -->
|
||||
<para>
|
||||
Returns associative array with detailed info about given date.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>date_parse_from_format</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$date = "6.1.2009 13:00+01:00";
|
||||
print_r(date_parse_from_format("j.n.Y H:iP", $date));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[year] => 2009
|
||||
[month] => 1
|
||||
[day] => 6
|
||||
[hour] => 13
|
||||
[minute] => 0
|
||||
[second] => 0
|
||||
[fraction] =>
|
||||
[warning_count] => 0
|
||||
[warnings] => Array
|
||||
(
|
||||
)
|
||||
|
||||
[error_count] => 0
|
||||
[errors] => Array
|
||||
(
|
||||
)
|
||||
|
||||
[is_localtime] => 1
|
||||
[zone_type] => 1
|
||||
[zone] => -60
|
||||
[is_dst] =>
|
||||
)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,104 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry xml:id="function.date-sub" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>date_sub</refname>
|
||||
<refpurpose>
|
||||
Subtracts an amount of days, months, years, hours, minutes and seconds from
|
||||
a DateTime object
|
||||
</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTime::sub</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_sub</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>DateInterval</type><parameter>interval</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Subtracts the specified <classname>DateInterval</classname> object from the specified DateTime
|
||||
object.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term>
|
||||
<parameter>interval</parameter>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
The amount to be subtracted. For the date use "P3D", "P3M", "P3Y" or a
|
||||
combination of the three e.g. "P2M5D" (Y = Years, M = Months, D = Days.)
|
||||
MUST BE YEAR MONTH DAY FORMAT "P5Y", "P5M2D", "P5Y4D". For the time use
|
||||
"T3H", "T3M", "T3S" or or a combination of the three e.g. "T5H20M" (H =
|
||||
Hours, M = Minutes, S = Seconds). For dateTime us "P5D2M4YT5H20M". The
|
||||
digit before the letter (NOT P or T) can be any amount.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>date_sub</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$date = new DateTime("18-July-2008 16:30:30");
|
||||
echo $date->format("d-m-Y H:i:s").'<br />';
|
||||
|
||||
date_sub($date, new DateInterval("P5D"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Days';
|
||||
|
||||
date_sub($date, new DateInterval("P5M"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Months';
|
||||
|
||||
date_sub($date, new DateInterval("P5Y"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Years';
|
||||
|
||||
date_sub($date, new DateInterval("P5Y5M5D"));
|
||||
echo '<br />'.$date->format("d-m-Y").' : 5 Days, 5 Months, 5 Years';
|
||||
|
||||
date_sub($date, new DateInterval("P5YT5H"));
|
||||
echo '<br />'.$date->format("d-m-Y H:i:s").' : 5 Years, 5 Hours';
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="notes">
|
||||
&reftitle.notes;
|
||||
&warn.experimental.func;
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>date_add</function></member>
|
||||
<member><function>date_diff</function></member>
|
||||
</simplelist>
|
||||
&info.function.alias; <methodname>DateTime::sub</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
|
@ -1,116 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<refentry xml:id="function.date-time-set" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>date_time_set</refname>
|
||||
<refpurpose>Sets the time</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTime::setTime</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_time_set</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>hour</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>minute</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>second</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>DateTime::setTime</methodname>
|
||||
<methodparam><type>int</type><parameter>hour</parameter></methodparam>
|
||||
<methodparam><type>int</type><parameter>minute</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>second</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Resets the current time of the DateTime object to a different time.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>hour</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Hour of the time.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>minute</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Minute of the time.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>second</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Second of the time.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &null; on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Changing the time of a DateTime object</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime('2008-08-03 12:35:23');
|
||||
echo $datetime->format('Y-m-d H:i:s') . "\n";
|
||||
|
||||
$datetime->setTime(14, 55, 24);
|
||||
echo $datetime->format('Y-m-d H:i:s') . "\n";
|
||||
|
||||
// Warning: Does not increment the hour!
|
||||
// This is because the hour has been set (14) - see date_modify()
|
||||
$datetime->setTime($datetime->format('H'), $datetime->format('n') + 6);
|
||||
echo $datetime->format('Y-m-d H:i:s') . "\n";
|
||||
|
||||
// *Does* increment the day, because the day has not been set
|
||||
$datetime->setTime($datetime->format('H') + 12, $datetime->format('n'));
|
||||
echo $datetime->format('Y-m-d H:i:s') . "\n";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
2008-08-03 12:35:23
|
||||
2008-08-03 14:55:24
|
||||
2008-08-03 14:14:00
|
||||
2008-08-04 02:08:00
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>date_date_set</function></member>
|
||||
</simplelist>
|
||||
&info.function.alias; <methodname>DateTime::setTime</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
38
reference/datetime/functions/date-timestamp-get.xml
Normal file
38
reference/datetime/functions/date-timestamp-get.xml
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="function.date-timestamp-get" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>date_timestamp_get</refname>
|
||||
<refpurpose>&Alias; <methodname>DateTime::getTimestamp</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<para>
|
||||
&info.function.alias; <methodname>DateTime::getTimestamp</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
38
reference/datetime/functions/date-timestamp-set.xml
Normal file
38
reference/datetime/functions/date-timestamp-set.xml
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="function.date-timestamp-set" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>date_timestamp_set</refname>
|
||||
<refpurpose>&Alias; <methodname>DateTime::setTimestamp</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<para>
|
||||
&info.function.alias; <methodname>DateTime::setTimestamp</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,76 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry xml:id="function.date-timezone-get" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>date_timezone_get</refname>
|
||||
<refpurpose>Return time zone relative to given DateTime</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTime::getTimezone</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>DateTimeZone</type><methodname>date_timezone_get</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>DateTimeZone</type><methodname>DateTime::getTimezone</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns DateTimeZone object on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Setting and getting DateTimeZone objects</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime('2008-08-03 12:35:23');
|
||||
echo $datetime->getTimezone()->getName() . "\n";
|
||||
|
||||
$datetime = new DateTime('2008-08-03 12:35:23');
|
||||
$la_time = new DateTimeZone('America/Los_Angeles');
|
||||
$datetime->setTimezone($la_time);
|
||||
echo $datetime->getTimezone()->getName();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Europe/London
|
||||
America/Los_Angeles
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>date_timezone_set</function></member>
|
||||
<member><function>timezone_open</function></member>
|
||||
</simplelist>
|
||||
&info.function.alias; <methodname>DateTime::getTimezone</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
|
@ -1,85 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry xml:id="function.date-timezone-set" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>date_timezone_set</refname>
|
||||
<refpurpose>Sets the time zone for the DateTime object</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTime::setTimezone</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>date_timezone_set</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>DateTimeZone</type><parameter>timezone</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>DateTime::setTimezone</methodname>
|
||||
<methodparam><type>DateTimeZone</type><parameter>timezone</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>timezone</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Desired time zone.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &null; on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Setting and getting DateTimeZone objects</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
date_default_timezone_set('Europe/London');
|
||||
|
||||
$datetime = new DateTime('2008-08-03 12:35:23');
|
||||
echo $datetime->getTimezone()->getName() . "\n";
|
||||
|
||||
$datetime = new DateTime('2008-08-03 12:35:23');
|
||||
$la_time = new DateTimeZone('America/Los_Angeles');
|
||||
$datetime->setTimezone($la_time);
|
||||
echo $datetime->getTimezone()->getName();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Europe/London
|
||||
America/Los_Angeles
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>date_timezone_get</function></member>
|
||||
<member><function>timezone_open</function></member>
|
||||
</simplelist>
|
||||
&info.function.alias; <methodname>DateTime::setTimezone</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
|
@ -1,88 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<refentry xml:id="function.timezone-abbreviations-list" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>timezone_abbreviations_list</refname>
|
||||
<refpurpose>Returns associative array containing dst, offset and the timezone name</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTimeZone::listAbbreviations</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>timezone_abbreviations_list</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>DateTimeZone::listAbbreviations</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns array on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>timezone_abbreviations_list</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$timezone_abbreviations = DateTimeZone::listAbbreviations();
|
||||
print_r($timezone_abbreviations["acst"]);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[0] => Array
|
||||
(
|
||||
[dst] => 1
|
||||
[offset] => -14400
|
||||
[timezone_id] => America/Porto_Acre
|
||||
)
|
||||
|
||||
[1] => Array
|
||||
(
|
||||
[dst] => 1
|
||||
[offset] => -14400
|
||||
[timezone_id] => America/Eirunepe
|
||||
)
|
||||
|
||||
[2] => Array
|
||||
(
|
||||
[dst] => 1
|
||||
[offset] => -14400
|
||||
[timezone_id] => America/Rio_Branco
|
||||
)
|
||||
|
||||
[3] => Array
|
||||
(
|
||||
[dst] => 1
|
||||
[offset] => -14400
|
||||
[timezone_id] => Brazil/Acre
|
||||
)
|
||||
|
||||
)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>timezone_identifiers_list</function></member>
|
||||
</simplelist>
|
||||
&info.function.alias; <methodname>DateTimeZone::listAbbreviations</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
|
@ -1,92 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<refentry xml:id="function.timezone-identifiers-list" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>timezone_identifiers_list</refname>
|
||||
<refpurpose>Returns numerically index array with all timezone identifiers</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTimeZone::listIdentifiers</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>timezone_identifiers_list</methodname>
|
||||
<methodparam><type>int</type><parameter>what</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>option</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>DateTimeZone::listIdentifiers</methodname>
|
||||
<methodparam><type>int</type><parameter>what</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>country</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetime.description;
|
||||
<varlistentry>
|
||||
<term><parameter>what</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
One of <classname>DateTimeZone</classname> class constants, defaults to
|
||||
<constant>DateTimeZone::ALL</constant>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>country</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A two-letter ISO 3166-1 compatible country code.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns array on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>timezone_identifiers_list</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$timezone_identifiers = DateTimeZone::listIdentifiers();
|
||||
for ($i=0; $i < 5; $i++) {
|
||||
echo "$timezone_identifiers[$i]\n";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Africa/Abidjan
|
||||
Africa/Accra
|
||||
Africa/Addis_Ababa
|
||||
Africa/Algiers
|
||||
Africa/Asmera
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>timezone_abbreviations_list</function></member>
|
||||
</simplelist>
|
||||
&info.function.alias; <methodname>DateTimeZone::listIdentifiers</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
38
reference/datetime/functions/timezone-location-get.xml
Normal file
38
reference/datetime/functions/timezone-location-get.xml
Normal file
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<refentry xml:id="function.timezone-location-get" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>timezone_location_get</refname>
|
||||
<refpurpose>&Alias; <methodname>DateTimeZone::getLocation</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<para>
|
||||
&info.function.alias; <methodname>DateTimeZone::getLocation</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
</refentry>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
sgml-omittag:t
|
||||
sgml-shorttag:t
|
||||
sgml-minimize-attributes:nil
|
||||
sgml-always-quote-attributes:t
|
||||
sgml-indent-step:1
|
||||
sgml-indent-data:t
|
||||
indent-tabs-mode:nil
|
||||
sgml-parent-document:nil
|
||||
sgml-default-dtd-file:"../../../../manual.ced"
|
||||
sgml-exposed-tags:nil
|
||||
sgml-local-catalogs:nil
|
||||
sgml-local-ecat-files:nil
|
||||
End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
|
@ -1,35 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<refentry xml:id="function.timezone-name-get" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>timezone_name_get</refname>
|
||||
<refpurpose>Returns the name of the timezone</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTimeZone::getName</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>timezone_name_get</methodname>
|
||||
<methodparam><type>DateTimeZone</type><parameter>object</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>DateTimeZone::getName</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetimezone.description;
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns time zone name on success or &false; on failure.
|
||||
&info.function.alias; <methodname>DateTimeZone::getName</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
|
@ -1,81 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<!-- $Revision: 1.6 $ -->
|
||||
<refentry xml:id="function.timezone-offset-get" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>timezone_offset_get</refname>
|
||||
<refpurpose>Returns the timezone offset from GMT</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTimeZone::getOffset</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>timezone_offset_get</methodname>
|
||||
<methodparam><type>DateTimeZone</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>DateTime</type><parameter>datetime</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>DateTimeZone::getOffset</methodname>
|
||||
<methodparam><type>DateTime</type><parameter>datetime</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function returns the offset to GMT for the date/time specified in the
|
||||
<parameter>datetime</parameter> parameter. The GMT offset is calculated
|
||||
with the timezone information contained in the DateTime object being used.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetimezone.description;
|
||||
<varlistentry>
|
||||
<term><parameter>datetime</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
DateTime that contains the date/time to compute the offset from.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns time zone offset in seconds on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>timezone_offset_get</function> examples</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Create two timezone objects, one for Taipei (Taiwan) and one for
|
||||
// Tokyo (Japan)
|
||||
$dateTimeZoneTaipei = new DateTimeZone("Asia/Taipei");
|
||||
$dateTimeZoneJapan = new DateTimeZone("Asia/Tokyo");
|
||||
|
||||
// Create two DateTime objects that will contain the same Unix timestamp, but
|
||||
// have different timezones attached to them.
|
||||
$dateTimeTaipei = new DateTime("now", $dateTimeZoneTaipei);
|
||||
$dateTimeJapan = new DateTime("now", $dateTimeZoneJapan);
|
||||
|
||||
// Calculate the GMT offset for the date/time contained in the $dateTimeTaipei
|
||||
// object, but using the timezone rules as defined for Tokyo
|
||||
// ($dateTimeZoneJapan).
|
||||
$timeOffset = $dateTimeZoneJapan->getOffset($dateTimeTaipei);
|
||||
|
||||
// Should show int(32400) (for dates after Sat Sep 8 01:00:00 1951 JST).
|
||||
var_dump($timeOffset);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
&info.function.alias; <methodname>DateTimeZone::getOffset</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
|
@ -1,66 +1,15 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.4 $ -->
|
||||
<!-- $Revision: 1.5 $ -->
|
||||
<refentry xml:id="function.timezone-transitions-get" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>timezone_transitions_get</refname>
|
||||
<refpurpose>Returns all transitions for the timezone</refpurpose>
|
||||
<refpurpose>&Alias; <methodname>DateTimeZone::getTransitions</methodname></refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>timezone_transitions_get</methodname>
|
||||
<methodparam><type>DateTimeZone</type><parameter>object</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>DateTimeZone::getTransitions</methodname>
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
&date.datetimezone.description;
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns numerically indexed array containing associative array with all
|
||||
transitions on success or &false; on failure.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>A <function>timezone_transitions_get</function> example</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$timezone = new DateTimeZone("CET");
|
||||
print_r(reset($timezone->getTransitions()));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[ts] => -1693706400
|
||||
[time] => 1916-04-30T22:00:00+0000
|
||||
[offset] => 7200
|
||||
[isdst] => 1
|
||||
[abbr] => CEST
|
||||
)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
&info.function.alias; <methodname>DateTimeZone::getTransitions</methodname>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
|
Loading…
Reference in a new issue