reference/datetime/functions/date.xml
7f385d3239d0df073e2208fb0c3c243ef13553bb
...
...
@@ -19,12 +19,14 @@
19
19
if no timestamp is given. In other words, <parameter>timestamp</parameter>
20
20
is optional and defaults to the value of <function>time</function>.
21
21
</para>
22
-
<para>
23
-
Unix timestamps do not handle timezones. Use the
24
-
<classname>DateTimeImmutable</classname> class, and its
25
-
<methodname>DateTimeInterface::format</methodname> formatting method to
26
-
format date/time information with a timezone attached.
27
-
</para>
22
+
<warning>
23
+
<para>
24
+
Unix timestamps do not handle timezones. Use the
25
+
<classname>DateTimeImmutable</classname> class, and its
26
+
<methodname>DateTimeInterface::format</methodname> formatting method to
27
+
format date/time information with a timezone attached.
28
+
</para>
29
+
</warning>
28
30
</refsect1>
29
31

30
32
<refsect1 role="parameters">
...
...
@@ -36,6 +38,15 @@
36
38
<para>
37
39
Format accepted by <methodname>DateTimeInterface::format</methodname>.
38
40
</para>
41
+
<note>
42
+
<simpara>
43
+
<function>date</function> will always generate
44
+
<literal>000000</literal> as microseconds since it takes an <type>int</type>
45
+
parameter, whereas <methodname>DateTime::format</methodname> does
46
+
support microseconds if <classname>DateTime</classname> was
47
+
created with microseconds.
48
+
</simpara>
49
+
</note>
39
50
</listitem>
40
51
</varlistentry>
41
52

...
...
@@ -47,9 +58,7 @@
47
58
<refsect1 role="returnvalues">
48
59
&reftitle.returnvalues;
49
60
<para>
50
-
Returns a formatted date string. If a non-numeric value is used for
51
-
<parameter>timestamp</parameter>, &false; is returned and an
52
-
<constant>E_WARNING</constant> level error is emitted.
61
+
Returns a formatted date string.
53
62
</para>
54
63
</refsect1>
55
64

...
...
@@ -226,7 +235,7 @@ $today = date("Y-m-d H:i:s"); // 2001-03-10 17:16:18 (the MySQ
226
235
<member><function>mktime</function></member>
227
236
<member><methodname>IntlDateFormatter::format</methodname></member>
228
237
<member><function>time</function></member>
229
-
<member><link linkend="datetime.constants.types">Predefined DateTime Constants</link></member>
238
+
<member><link linkend="datetimeinterface.constants.types">Predefined DateTime Constants</link></member>
230
239
</simplelist>
231
240
</para>
232
241
</refsect1>
233
242