<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="datetime.createfromformat" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
 <refnamediv>
  <refname>DateTime::createFromFormat</refname>
  <refname>date_create_from_format</refname>
  <refpurpose>Parses a time string according to a specified format</refpurpose>
 </refnamediv>

 <refsect1 role="description">
  &reftitle.description;
  <para>&style.oop;</para>
  <methodsynopsis role="DateTime">
   <modifier>public</modifier> <modifier>static</modifier> <type class="union"><type>DateTime</type><type>false</type></type><methodname>DateTime::createFromFormat</methodname>
   <methodparam><type>string</type><parameter>format</parameter></methodparam>
   <methodparam><type>string</type><parameter>datetime</parameter></methodparam>
   <methodparam choice="opt"><type class="union"><type>DateTimeZone</type><type>null</type></type><parameter>timezone</parameter><initializer>&null;</initializer></methodparam>
  </methodsynopsis>
  <para>&style.procedural;</para>
  <methodsynopsis>
   <type class="union"><type>DateTime</type><type>false</type></type><methodname>date_create_from_format</methodname>
   <methodparam><type>string</type><parameter>format</parameter></methodparam>
   <methodparam><type>string</type><parameter>datetime</parameter></methodparam>
   <methodparam choice="opt"><type class="union"><type>DateTimeZone</type><type>null</type></type><parameter>timezone</parameter><initializer>&null;</initializer></methodparam>
  </methodsynopsis>
  <para>
   Returns a new DateTime object representing the date and time specified by the
   <parameter>datetime</parameter> string, which was formatted in the given
   <parameter>format</parameter>.
  </para>
  <para>
   Like <methodname>DateTimeImmutable::createFromFormat</methodname>
   and <function>date_create_immutable_from_format</function>, respectively, but
   creates a <classname>DateTime</classname> object.
  </para>
  <para>
   This method, including parameters, examples, and considerations are
   documented on the <link
   linkend="datetimeimmutable.createfromformat">DateTimeImmutable::createFromFormat</link>
   page.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   See <link
   linkend="datetimeimmutable.createfromformat">DateTimeImmutable::createFromFormat</link>.
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns a new DateTime instance&return.falseforfailure;.
  </para>
 </refsect1>

 <refsect1 role="errors">
  &reftitle.errors;
  <para>
   This method throws <exceptionname>ValueError</exceptionname> when the
   <parameter>datetime</parameter> contains NULL-bytes.
  </para>
 </refsect1>

 <refsect1 role="changelog">
  &reftitle.changelog;
  <informaltable>
   <tgroup cols="2">
    <thead>
     <row>
      <entry>&Version;</entry>
      <entry>&Description;</entry>
     </row>
    </thead>
    <tbody>
     <row>
      <entry>8.0.21, 8.1.8, 8.2.0</entry>
      <entry>
       Now throws <exceptionname>ValueError</exceptionname> when NULL-bytes
       are passed into <parameter>datetime</parameter>, which previously was silently
       ignored.
      </entry>
     </row>
    </tbody>
   </tgroup>
  </informaltable>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   For an extensive set of examples, see <link
   linkend="datetimeimmutable.createfromformat">DateTimeImmutable::createFromFormat</link>.
  </para>
 </refsect1>

 <refsect1 role="seealso">
  &reftitle.seealso;
  <simplelist>
   <member><function>DateTimeImmutable::createFromFormat</function></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
-->
