<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="dateperiod.getenddate" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>DatePeriod::getEndDate</refname>
  <refpurpose>
   Gets the end date
  </refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <para>&style.oop;</para>
  <methodsynopsis role="DatePeriod">
   <modifier>public</modifier> <type class="union"><type>DateTimeInterface</type><type>null</type></type><methodname>DatePeriod::getEndDate</methodname>
   <void/>
  </methodsynopsis>
  <para>
   Gets the end date of the period.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  &no.function.parameters;
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns &null; if the <classname>DatePeriod</classname> does
   not have an end date. For example, when initialized with the
   <parameter>recurrences</parameter> parameter, or the
   <parameter>isostr</parameter> parameter without an
   end date.
  </para>
  <para>
   Returns a <classname>DateTimeImmutable</classname> <type>object</type>
   when the <classname>DatePeriod</classname> is initialized with a
   <classname>DateTimeImmutable</classname> <type>object</type>
   as the <parameter>end</parameter> parameter.
  </para>
  <para>
   Returns a cloned <classname>DateTime</classname> <type>object</type>
   representing the end date otherwise.
  </para>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <example>
   <title><methodname>DatePeriod::getEndDate</methodname> example</title>
   <programlisting role="php">
<![CDATA[
<?php
$period = new DatePeriod(
    new DateTime('2016-05-16T00:00:00Z'),
    new DateInterval('P1D'),
    new DateTime('2016-05-20T00:00:00Z')
);
$start = $period->getEndDate();
echo $start->format(DateTime::ISO8601);
?>
]]>
   </programlisting>
   &examples.outputs;
   <screen>
<![CDATA[
2016-05-20T00:00:00+0000
]]>
   </screen>
  </example>
  <example>
   <title><methodname>DatePeriod::getEndDate</methodname> without an end date</title>
   <programlisting role="php">
<![CDATA[
<?php
$period = new DatePeriod(
    new DateTime('2016-05-16T00:00:00Z'),
    new DateInterval('P1D'),
    7
);
var_dump($period->getEndDate());
?>
]]>
   </programlisting>
   &example.outputs;
   <screen>
<![CDATA[
NULL
]]>
   </screen>
  </example>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member><methodname>DatePeriod::getStartDate</methodname></member>
   <member><methodname>DatePeriod::getDateInterval</methodname></member>
  </simplelist>
 </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:"~/.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
-->
