reference/datetime/datetime.xml
14767af0f05dffa6fdb9b49e1a1f4e9ca7022a60
...
...
@@ -1,6 +1,5 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-

4
3
<phpdoc:classref xml:id="class.datetime" xmlns:phpdoc="http://php.net/ns/phpdoc" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
5
4

6
5
<title>The DateTime class</title>
...
...
@@ -14,6 +13,21 @@
14
13
<para>
15
14
Representation of date and time.
16
15
</para>
16
+
<para>
17
+
This class behaves the same as <classname>DateTimeImmutable</classname>,
18
+
except objects are modified itself when modification methods such as
19
+
<function>DateTime::modify</function> are called.
20
+
</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>
17
31
</section>
18
32
<!-- }}} -->
19
33

...
...
@@ -21,40 +35,32 @@
21
35
&reftitle.classsynopsis;
22
36

23
37
<!-- {{{ Synopsis -->
24
-
<classsynopsis>
25
-
<ooclass><classname>DateTime</classname></ooclass>
38
+
<classsynopsis class="class">
39
+
<ooclass>
40
+
<classname>DateTime</classname>
41
+
</ooclass>
42
+

43
+
<oointerface>
44
+
<modifier>implements</modifier>
45
+
<interfacename>DateTimeInterface</interfacename>
46
+
</oointerface>
26
47

27
-
<!-- {{{ Class synopsis -->
28
-
<classsynopsisinfo>
29
-
<ooclass>
30
-
<classname>DateTime</classname>
31
-
</ooclass>
32
-
<oointerface>
33
-
<interfacename>DateTimeInterface</interfacename>
34
-
</oointerface>
35
-
</classsynopsisinfo>
36
-
<!-- }}} -->
37
48
<classsynopsisinfo role="comment">&InheritedConstants;</classsynopsisinfo>
38
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;']]))">
39
-
<xi:fallback />
50
+
<xi:fallback/>
40
51
</xi:include>
41
52

42
53
<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
43
-
<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')])">
44
-
<xi:fallback />
45
-
</xi:include>
46
-
<!--
47
-
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.datetime')/db:refentry/db:refsect1[@role='description']/descendant::db:destructorsynopsis[not(@role='procedural')])">
48
-
<xi:fallback />
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'])">
55
+
<xi:fallback/>
49
56
</xi:include>
50
-
-->
51
-
<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')])">
52
-
<xi:fallback />
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'])">
58
+
<xi:fallback/>
53
59
</xi:include>
54
-
55
-
<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'])" />
56
-

57
-
</classsynopsis>
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'])">
61
+
<xi:fallback/>
62
+
</xi:include>
63
+
</classsynopsis>
58
64
<!-- }}} -->
59
65

60
66
</section>
...
...
@@ -79,32 +85,11 @@
79
85
</entry>
80
86
</row>
81
87
<row>
82
-
<entry>7.0.0</entry>
88
+
<entry>7.1.0</entry>
83
89
<entry>
84
-
Added constants: <link linkend="datetime.constants.rfc3339_extended">DATE_RFC3339_EXTENDED</link> and
85
-
<link linkend="datetime.constants.rfc3339_extended">DateTime::RFC3339_EXTENDED</link>.
86
-
</entry>
87
-
</row>
88
-
<row>
89
-
<entry>5.5.0</entry>
90
-
<entry>
91
-
The class now implements <classname>DateTimeInterface</classname>.
92
-
</entry>
93
-
</row>
94
-
<row>
95
-
<entry>5.4.24</entry>
96
-
<entry>
97
-
The COOKIE constant was changed to reflect RFC 1036 using a four digit
98
-
year rather than a two digit year (RFC 850) as prior versions.
99
-
</entry>
100
-
</row>
101
-
<row>
102
-
<entry>5.2.2</entry>
103
-
<entry>
104
-
DateTime object comparison with the
105
-
<link linkend="language.operators.comparison">comparison operators</link>
106
-
changed to work as expected. Previously, all DateTime objects were
107
-
considered equal (using <literal>==</literal>).
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>.
108
93
</entry>
109
94
</row>
110
95
</tbody>
...
...
@@ -119,7 +104,6 @@
119
104
&reference.datetime.entities.datetime;
120
105

121
106
</phpdoc:classref>
122
-

123
107
<!-- Keep this comment at the end of the file
124
108
Local variables:
125
109
mode: sgml
126
110