reference/datetime/functions/strptime.xml
5c951013ca04161992efed8b86fb40f55669958e
...
...
@@ -1,22 +1,27 @@
1
1
<?xml version="1.0" encoding="utf-8"?>
2
2
<!-- $Revision$ -->
3
-
<refentry xml:id="function.strptime" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+
<refentry xml:id="function.strptime" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
4
4
<refnamediv>
5
5
<refname>strptime</refname>
6
6
<refpurpose>
7
7
Parse a time/date generated with <function>strftime</function>
8
8
</refpurpose>
9
9
</refnamediv>
10
+

11
+
<refsynopsisdiv>
12
+
&warn.deprecated.function-8-1-0;
13
+
</refsynopsisdiv>
14
+
10
15
<refsect1 role="description">
11
16
&reftitle.description;
12
17
<methodsynopsis>
13
-
<type>array</type><methodname>strptime</methodname>
14
-
<methodparam><type>string</type><parameter>date</parameter></methodparam>
15
-
<methodparam><type>string</type><parameter>format</parameter></methodparam>
16
-
</methodsynopsis>
18
+
<type class="union"><type>array</type><type>false</type></type><methodname>strptime</methodname>
19
+
<methodparam><type>string</type><parameter>timestamp</parameter></methodparam>
20
+
<methodparam><type>string</type><parameter>format</parameter></methodparam>
21
+
</methodsynopsis>
17
22
<para>
18
23
<function>strptime</function> returns an array with the
19
-
<parameter>date</parameter> parsed, or &false; on error.
24
+
<parameter>timestamp</parameter> parsed, or &false; on error.
20
25
</para>
21
26
<para>
22
27
Month and weekday names and other language dependent strings respect the
...
...
@@ -29,7 +34,7 @@
29
34
<para>
30
35
<variablelist>
31
36
<varlistentry>
32
-
<term><parameter>date</parameter> (<type>string</type>)</term>
37
+
<term><parameter>timestamp</parameter> (<type>string</type>)</term>
33
38
<listitem>
34
39
<para>
35
40
The string to parse (e.g. returned from <function>strftime</function>).
...
...
@@ -40,7 +45,7 @@
40
45
<term><parameter>format</parameter> (<type>string</type>)</term>
41
46
<listitem>
42
47
<para>
43
-
The format used in <parameter>date</parameter> (e.g. the same as
48
+
The format used in <parameter>timestamp</parameter> (e.g. the same as
44
49
used in <function>strftime</function>). Note that some of the format
45
50
options available to <function>strftime</function> may not have any
46
51
effect within <function>strptime</function>; the exact subset that are
...
...
@@ -108,7 +113,7 @@
108
113
</row>
109
114
<row>
110
115
<entry><literal>"unparsed"</literal></entry>
111
-
<entry>the <parameter>date</parameter> part which was not
116
+
<entry>the <parameter>timestamp</parameter> part which was not
112
117
recognized using the specified <parameter>format</parameter></entry>
113
118
</row>
114
119
</tbody>
...
...
@@ -118,6 +123,32 @@
118
123

119
124
</refsect1>
120
125

126
+
<refsect1 role="changelog">
127
+
&reftitle.changelog;
128
+
<para>
129
+
<informaltable>
130
+
<tgroup cols="2">
131
+
<thead>
132
+
<row>
133
+
<entry>&Version;</entry>
134
+
<entry>&Description;</entry>
135
+
</row>
136
+
</thead>
137
+
<tbody>
138
+
<row>
139
+
<entry>8.1.0</entry>
140
+
<entry>
141
+
This function has been deprecated.
142
+
Use <function>date_parse_from_format</function> instead (for locale-independent parsing),
143
+
or <methodname>IntlDateFormatter::parse</methodname> (for locale-dependent parsing)
144
+
</entry>
145
+
</row>
146
+
</tbody>
147
+
</tgroup>
148
+
</informaltable>
149
+
</para>
150
+
</refsect1>
151
+

121
152
<refsect1 role="examples">
122
153
&reftitle.examples;
123
154
<para>
...
...
@@ -167,7 +198,7 @@ Array
167
198
function provided by the system's C library. This function can exhibit
168
199
noticeably different behaviour across different operating systems. The
169
200
use of <function>date_parse_from_format</function>, which does not
170
-
suffer from these issues, is recommended on PHP 5.3.0 and later.
201
+
suffer from these issues, is recommended.
171
202
</para>
172
203
</note>
173
204
<note>
...
...
@@ -178,28 +209,21 @@ Array
178
209
on leap seconds</link>.
179
210
</para>
180
211
</note>
181
-
<note>
182
-
<para>
183
-
Prior to PHP 5.2.0, this function could return undefined behaviour. Notably,
184
-
the <literal>"tm_sec"</literal>, <literal>"tm_min"</literal> and <literal>"tm_hour"</literal>
185
-
entries would return undefined values.
186
-
</para>
187
-
</note>
188
212
</refsect1>
189
213

190
214
<refsect1 role="seealso">
191
215
&reftitle.seealso;
192
216
<para>
193
217
<simplelist>
218
+
<member><methodname>IntlDateFormatter::parse</methodname></member>
219
+
<member><methodname>DateTime::createFromFormat</methodname></member>
194
220
<member><function>checkdate</function></member>
195
221
<member><function>strftime</function></member>
196
222
<member><function>date_parse_from_format</function></member>
197
-
<member><function>DateTime::createFromFormat</function></member>
198
223
</simplelist>
199
224
</para>
200
225
</refsect1>
201
226
</refentry>
202
-

203
227
<!-- Keep this comment at the end of the file
204
228
Local variables:
205
229
mode: sgml
206
230