mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 10:28:54 +00:00

- array functions - datetime functions - mbstring functions - strings functions - var functions - xml functions - json functions
246 lines
7 KiB
XML
246 lines
7 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<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>
|
|
Represents a date interval.
|
|
</para>
|
|
<para>
|
|
A date interval stores either a fixed amount of time (in years, months,
|
|
days, hours etc) or a relative time string in the format that
|
|
<classname>DateTime</classname>'s constructor supports.
|
|
</para>
|
|
<para>
|
|
More specifically, the information in an object of the
|
|
<classname>DateInterval</classname> class is an instruction to get from
|
|
one date/time to another date/time. This process is not always reversible.
|
|
</para>
|
|
<para>
|
|
A common way to create a <classname>DateInterval</classname> object
|
|
is by calculating the difference between two date/time objects through
|
|
<function>DateTimeInterface::diff</function>.
|
|
</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">&Properties;</classsynopsisinfo>
|
|
<fieldsynopsis>
|
|
<modifier>public</modifier>
|
|
<type>int</type>
|
|
<varname linkend="dateinterval.props.y">y</varname>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>public</modifier>
|
|
<type>int</type>
|
|
<varname linkend="dateinterval.props.m">m</varname>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>public</modifier>
|
|
<type>int</type>
|
|
<varname linkend="dateinterval.props.d">d</varname>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>public</modifier>
|
|
<type>int</type>
|
|
<varname linkend="dateinterval.props.h">h</varname>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>public</modifier>
|
|
<type>int</type>
|
|
<varname linkend="dateinterval.props.i">i</varname>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>public</modifier>
|
|
<type>int</type>
|
|
<varname linkend="dateinterval.props.s">s</varname>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>public</modifier>
|
|
<type>float</type>
|
|
<varname linkend="dateinterval.props.f">f</varname>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>public</modifier>
|
|
<type>int</type>
|
|
<varname linkend="dateinterval.props.invert">invert</varname>
|
|
</fieldsynopsis>
|
|
<fieldsynopsis>
|
|
<modifier>public</modifier>
|
|
<type>mixed</type>
|
|
<varname linkend="dateinterval.props.days">days</varname>
|
|
</fieldsynopsis>
|
|
|
|
<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:constructorsynopsis[not(@role='procedural')])">
|
|
<xi:fallback />
|
|
</xi:include>
|
|
<!--
|
|
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.dateinterval')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[not(@role='procedural')])">
|
|
<xi:fallback />
|
|
</xi:include>
|
|
-->
|
|
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.dateinterval')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])">
|
|
<xi:fallback />
|
|
</xi:include>
|
|
|
|
</classsynopsis>
|
|
<!-- }}} -->
|
|
|
|
</section>
|
|
|
|
<section xml:id="dateinterval.props">
|
|
&reftitle.properties;
|
|
<variablelist>
|
|
<varlistentry xml:id="dateinterval.props.y">
|
|
<term><varname>y</varname></term>
|
|
<listitem>
|
|
<para>
|
|
Number of years.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="dateinterval.props.m">
|
|
<term><varname>m</varname></term>
|
|
<listitem>
|
|
<para>
|
|
Number of months.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="dateinterval.props.d">
|
|
<term><varname>d</varname></term>
|
|
<listitem>
|
|
<para>
|
|
Number of days.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="dateinterval.props.h">
|
|
<term><varname>h</varname></term>
|
|
<listitem>
|
|
<para>
|
|
Number of hours.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="dateinterval.props.i">
|
|
<term><varname>i</varname></term>
|
|
<listitem>
|
|
<para>
|
|
Number of minutes.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="dateinterval.props.s">
|
|
<term><varname>s</varname></term>
|
|
<listitem>
|
|
<para>
|
|
Number of seconds.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="dateinterval.props.f">
|
|
<term><varname>f</varname></term>
|
|
<listitem>
|
|
<para>
|
|
Number of microseconds, as a fraction of a second.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="dateinterval.props.invert">
|
|
<term><varname>invert</varname></term>
|
|
<listitem>
|
|
<para>
|
|
Is <literal>1</literal> if the interval
|
|
represents a negative time period and
|
|
<literal>0</literal> otherwise.
|
|
See <methodname>DateInterval::format</methodname>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="dateinterval.props.days">
|
|
<term><varname>days</varname></term>
|
|
<listitem>
|
|
<para>
|
|
If the DateInterval object was created by
|
|
<function>DateTime::diff</function>, then this is the total number of
|
|
days between the start and end dates. Otherwise,
|
|
<varname>days</varname> will be &false;.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</section>
|
|
|
|
<section role="changelog" xml:id="dateinterval.changelog"><!-- {{{ -->
|
|
&reftitle.changelog;
|
|
<para>
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>7.1.0</entry>
|
|
<entry>The <varname>f</varname> property was added.</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</para>
|
|
</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:"~/.phpdoc/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
|
|
-->
|