reference/datetime/datetime.xml
c9490d424ec11a4fe92f07f08cff95c85c7d22df
c9490d424ec11a4fe92f07f08cff95c85c7d22df
...
...
@@ -1,7 +1,6 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
4
-
<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">
3
+
<reference xml:id="class.datetime" role="class" 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>
7
6
<titleabbrev>DateTime</titleabbrev>
...
...
@@ -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,105 +35,81 @@
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>
61
67
62
-
<section role="changelog" xml:id="datetime.changelog"><!-- {{{ -->
63
-
&reftitle.changelog;
64
-
<para>
65
-
<informaltable>
66
-
<tgroup cols="2">
67
-
<thead>
68
-
<row>
69
-
<entry>&Version;</entry>
70
-
<entry>&Description;</entry>
71
-
</row>
72
-
</thead>
73
-
<tbody>
74
-
<row>
75
-
<entry>7.2.0</entry>
76
-
<entry>
77
-
The class constants of <classname>DateTime</classname> are now defined
78
-
on <classname>DateTimeInterface</classname>.
79
-
</entry>
80
-
</row>
81
-
<row>
82
-
<entry>7.0.0</entry>
83
-
<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>).
108
-
</entry>
109
-
</row>
110
-
</tbody>
111
-
</tgroup>
112
-
</informaltable>
113
-
</para>
114
-
</section><!-- }}} -->
68
+
<section role="changelog" xml:id="datetime.changelog"><!-- {{{ -->
69
+
&reftitle.changelog;
70
+
<para>
71
+
<informaltable>
72
+
<tgroup cols="2">
73
+
<thead>
74
+
<row>
75
+
<entry>&Version;</entry>
76
+
<entry>&Description;</entry>
77
+
</row>
78
+
</thead>
79
+
<tbody>
80
+
<row>
81
+
<entry>8.4.0</entry>
82
+
<entry>
83
+
The class constants are now typed.
84
+
</entry>
85
+
</row>
86
+
<row>
87
+
<entry>7.2.0</entry>
88
+
<entry>
89
+
The class constants of <classname>DateTime</classname> are now defined
90
+
on <classname>DateTimeInterface</classname>.
91
+
</entry>
92
+
</row>
93
+
<row>
94
+
<entry>7.1.0</entry>
95
+
<entry>
96
+
The <classname>DateTime</classname> constructor now includes the
97
+
current microseconds in the constructed value. Before this, it would
98
+
always initialise the microseconds to <literal>0</literal>.
99
+
</entry>
100
+
</row>
101
+
</tbody>
102
+
</tgroup>
103
+
</informaltable>
104
+
</para>
105
+
</section><!-- }}} -->
115
106
116
107
117
108
</partintro>
118
109
119
110
&reference.datetime.entities.datetime;
120
111
121
-
</phpdoc:classref>
122
-
112
+
</reference>
123
113
<!-- Keep this comment at the end of the file
124
114
Local variables:
125
115
mode: sgml
126
116