reference/datetime/book.xml
71692b6f4cace8dca72a18ccd80d4cd7305e5d4e
...
...
@@ -10,28 +10,31 @@
10
10
<preface xml:id="intro.datetime">
11
11
&reftitle.intro;
12
12
<para>
13
-
These functions allow you to get the date and time from the server
14
-
where your PHP scripts are running. You can use these functions to format the
15
-
date and time in many different ways.
13
+
The <classname>DateTimeImmutable</classname> and related classes allow you
14
+
represent date/time information. The objects can be created by passing in a
15
+
string presentation of date/time information, or from the current system's
16
+
time.
17
+
</para>
18
+
<para>
19
+
A rich set of methods is supplied to modify and format this information
20
+
as well, including handling timezones and DST transitions.
21
+
</para>
22
+
<para>
23
+
The date/time features in PHP implements the ISO 8601 calendar, which is a
24
+
<link xlink:href="&url.proleptic-gregorian-calendar;">proleptic Gregorian
25
+
calendar</link> which implements the current leap-day rules from before the
26
+
Gregorian calendar was in place, and also includes the year
27
+
<literal>0</literal> as the year number in between <literal>-1
28
+
BCE</literal> and <literal>1 CE</literal>. Leap seconds are not supported.
16
29
</para>
17
30
<para>
18
31
The date and time information is internally stored as a 64-bit number so
19
-
all conceivably useful dates (including negative years) are supported. The range is from about 292
20
-
billion years in the past to the same in the future.
32
+
all conceivably useful dates (including negative years) are supported. The
33
+
range is from about 292 billion years in the past to the same in the
34
+
future.
21
35
</para>
22
36
<note>
23
37
<simpara>
24
-
Please keep in mind that these functions are dependent on
25
-
the locale settings of your server. Make sure to take
26
-
daylight saving time (use e.g.
27
-
<literal>$date = strtotime('+7 days', $date)</literal> and not
28
-
<literal>$date += 7*24*60*60</literal>)
29
-
and leap years into consideration when working
30
-
with these functions.
31
-
</simpara>
32
-
</note>
33
-
<note>
34
-
<simpara>
35
38
The timezones referenced in this section can be found in the
36
39
<xref linkend="timezones"/>.
37
40
</simpara>
...
...
@@ -41,6 +44,7 @@
41
44

42
45
&reference.datetime.setup;
43
46
&reference.datetime.constants;
47
+
&reference.datetime.examples;
44
48

45
49
&reference.datetime.datetime;
46
50
&reference.datetime.datetimeimmutable;
...
...
@@ -50,9 +54,50 @@
50
54
&reference.datetime.dateperiod;
51
55

52
56
&reference.datetime.reference;
57
+

58
+
<article xml:id="datetime.error.tree">
59
+
<title>Date/Time Errors and Exceptions</title>
60
+

61
+
<itemizedlist>
62
+
<listitem>
63
+
<simpara><exceptionname>DateError</exceptionname> (extends <exceptionname>Error</exceptionname>)</simpara>
64
+
<itemizedlist>
65
+
<listitem>
66
+
<simpara><exceptionname>DateObjectError</exceptionname></simpara>
67
+
<simpara><exceptionname>DateRangeError</exceptionname></simpara>
68
+
</listitem>
69
+
</itemizedlist>
70
+
</listitem>
71
+
<listitem>
72
+
<simpara><exceptionname>DateException</exceptionname> (extends <exceptionname>Exception</exceptionname>)</simpara>
73
+
<itemizedlist>
74
+
<listitem>
75
+
<itemizedlist>
76
+
<listitem><simpara><exceptionname>DateInvalidOperationException</exceptionname></simpara></listitem>
77
+
<listitem><simpara><exceptionname>DateInvalidTimezoneException</exceptionname></simpara></listitem>
78
+
<listitem><simpara><exceptionname>DateMalformedIntervalStringException</exceptionname></simpara></listitem>
79
+
<listitem><simpara><exceptionname>DateMalformedPeriodStringException</exceptionname></simpara></listitem>
80
+
<listitem><simpara><exceptionname>DateMalformedStringException</exceptionname></simpara></listitem>
81
+
</itemizedlist>
82
+
</listitem>
83
+
</itemizedlist>
84
+
</listitem>
85
+
</itemizedlist>
86
+
</article>
87
+

53
88
&reference.datetime.formats;
54
89
&reference.datetime.timezones;
55
90

91
+
&reference.datetime.dateerror;
92
+
&reference.datetime.dateobjecterror;
93
+
&reference.datetime.daterangeerror;
94
+
&reference.datetime.dateexception;
95
+
&reference.datetime.dateinvalidoperationexception;
96
+
&reference.datetime.dateinvalidtimezoneexception;
97
+
&reference.datetime.datemalformedintervalstringexception;
98
+
&reference.datetime.datemalformedperiodstringexception;
99
+
&reference.datetime.datemalformedstringexception;
100
+

56
101
</book>
57
102

58
103
<!-- Keep this comment at the end of the file
59
104