reference/datetime/datetime.xml
14767af0f05dffa6fdb9b49e1a1f4e9ca7022a60
...
...
@@ -14,14 +14,20 @@
14
14
Representation of date and time.
15
15
</para>
16
16
<para>
17
-
This class behaves the same as <classname>DateTimeImmutable</classname>
17
+
This class behaves the same as <classname>DateTimeImmutable</classname>,
18
18
except objects are modified itself when modification methods such as
19
19
<function>DateTime::modify</function> are called.
20
20
</para>
21
-
<para>
22
-
Using <classname>DateTimeImmutable</classname> over this class is
23
-
recommended.
24
-
</para>
21
+
<warning>
22
+
<para>
23
+
Calling methods on objects of the class <classname>DateTime</classname>
24
+
will change the information encapsulated in these objects, if you want to
25
+
prevent that you will have to use <literal>clone</literal> operator to
26
+
create a new object. Use <classname>DateTimeImmutable</classname>
27
+
instead of <classname>DateTime</classname> to obtain this recommended
28
+
behaviour by default.
29
+
</para>
30
+
</warning>
25
31
</section>
26
32
<!-- }}} -->
27
33

...
...
@@ -29,34 +35,29 @@
29
35
&reftitle.classsynopsis;
30
36

31
37
<!-- {{{ Synopsis -->
32
-
<classsynopsis>
38
+
<classsynopsis class="class">
33
39
<ooclass>
34
40
<classname>DateTime</classname>
35
41
</ooclass>
36
42

37
-
<classsynopsisinfo>
38
-
<ooclass>
39
-
<classname>DateTime</classname>
40
-
</ooclass>
41
-

42
-
<oointerface>
43
-
<interfacename>DateTimeInterface</interfacename>
44
-
</oointerface>
45
-
</classsynopsisinfo>
43
+
<oointerface>
44
+
<modifier>implements</modifier>
45
+
<interfacename>DateTimeInterface</interfacename>
46
+
</oointerface>
46
47

47
48
<classsynopsisinfo role="comment">&InheritedConstants;</classsynopsisinfo>
48
49
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.datetimeinterface')/db:partintro/db:section/db:classsynopsis/db:fieldsynopsis[preceding-sibling::db:classsynopsisinfo[1][@role='comment' and text()='&Constants;']]))">
49
-
<xi:fallback />
50
+
<xi:fallback/>
50
51
</xi:include>
51
52

52
53
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
53
-
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.datetime')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[not(@role='procedural')])">
54
+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.datetime')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='DateTime'])">
54
55
<xi:fallback/>
55
56
</xi:include>
56
-
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.datetime')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[not(@role='procedural')])">
57
+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.datetime')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='DateTime'])">
57
58
<xi:fallback/>
58
59
</xi:include>
59
-
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.datetimeinterface')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='oop'])">
60
+
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.datetimeinterface')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='DateTime'])">
60
61
<xi:fallback/>
61
62
</xi:include>
62
63
</classsynopsis>
...
...
@@ -83,6 +84,14 @@
83
84
on <classname>DateTimeInterface</classname>.
84
85
</entry>
85
86
</row>
87
+
<row>
88
+
<entry>7.1.0</entry>
89
+
<entry>
90
+
The <classname>DateTime</classname> constructor now includes the
91
+
current microseconds in the constructed value. Before this, it would
92
+
always initialise the microseconds to <literal>0</literal>.
93
+
</entry>
94
+
</row>
86
95
</tbody>
87
96
</tgroup>
88
97
</informaltable>
89
98