reference/datetime/functions/date-create.xml
71692b6f4cace8dca72a18ccd80d4cd7305e5d4e
...
...
@@ -3,18 +3,51 @@
3
3
<refentry xml:id="function.date-create" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>date_create</refname>
6
-
<refpurpose>&Alias; <methodname>DateTime::__construct</methodname></refpurpose>
6
+
<refpurpose>create a new <classname>DateTime</classname> object</refpurpose>
7
7
</refnamediv>
8
8

9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
+
<methodsynopsis>
12
+
<type class="union"><type>DateTime</type><type>false</type></type><methodname>date_create</methodname>
13
+
<methodparam choice="opt"><type>string</type><parameter>datetime</parameter><initializer>"now"</initializer></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>DateTimeZone</type><type>null</type></type><parameter>timezone</parameter><initializer>&null;</initializer></methodparam>
15
+
</methodsynopsis>
11
16
<para>
12
-
&info.function.alias; <methodname>DateTime::__construct</methodname>
17
+
This is the procedural version of
18
+
<methodname>DateTime::__construct</methodname>.
19
+
</para>
20
+
<para>
21
+
Unlike the <classname>DateTime</classname> constructor, it will return
22
+
&false; instead of an exception if the passed in
23
+
<parameter>datetime</parameter> string is invalid.
13
24
</para>
14
25
</refsect1>
15
26
16
-
</refentry>
27
+
<refsect1 role="parameters">
28
+
&reftitle.parameters;
29
+
<para>
30
+
See <link linkend="datetimeimmutable.construct">DateTimeImmutable::__construct</link>.
31
+
</para>
32
+
</refsect1>
17
33

34
+
<refsect1 role="returnvalues">
35
+
&reftitle.returnvalues;
36
+
<para>
37
+
Returns a new DateTime instance &return.falseforfailure;
38
+
</para>
39
+
</refsect1>
40
+

41
+
<refsect1 role="seealso">
42
+
&reftitle.seealso;
43
+
<simplelist>
44
+
<member><methodname>DateTimeImmutable::__construct</methodname></member>
45
+
<member><methodname>DateTimeImmutable::createFromFormat</methodname></member>
46
+
<member><methodname>DateTime::__construct</methodname></member>
47
+
</simplelist>
48
+
</refsect1>
49
+

50
+
</refentry>
18
51
<!-- Keep this comment at the end of the file
19
52
Local variables:
20
53
mode: sgml
21
54