reference/datetime/functions/idate.xml
5c951013ca04161992efed8b86fb40f55669958e
...
...
@@ -3,15 +3,15 @@
3
3
<refentry xml:id="function.idate" xmlns="http://docbook.org/ns/docbook">
4
4
<refnamediv>
5
5
<refname>idate</refname>
6
-
<refpurpose>Format a local time/date as integer</refpurpose>
6
+
<refpurpose>Format a local time/date part as integer</refpurpose>
7
7
</refnamediv>
8
8

9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>int</type><methodname>idate</methodname>
12
+
<type class="union"><type>int</type><type>false</type></type><methodname>idate</methodname>
13
13
<methodparam><type>string</type><parameter>format</parameter></methodparam>
14
-
<methodparam choice="opt"><type>int</type><parameter>timestamp</parameter><initializer>time()</initializer></methodparam>
14
+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>timestamp</parameter><initializer>&null;</initializer></methodparam>
15
15
</methodsynopsis>
16
16
<para>
17
17
Returns a number formatted according to the given format string using the
...
...
@@ -79,6 +79,15 @@
79
79
<entry>Month number</entry>
80
80
</row>
81
81
<row>
82
+
<entry><literal>N</literal></entry>
83
+
<entry>ISO-8601 day of the week (<literal>1</literal> for Monday
84
+
through <literal>7</literal> for Sunday)</entry>
85
+
</row>
86
+
<row>
87
+
<entry><literal>o</literal></entry>
88
+
<entry>ISO-8601 year (4 digits)</entry>
89
+
</row>
90
+
<row>
82
91
<entry><literal>s</literal></entry>
83
92
<entry>Seconds</entry>
84
93
</row>
...
...
@@ -132,10 +141,10 @@
132
141
<refsect1 role="returnvalues">
133
142
&reftitle.returnvalues;
134
143
<para>
135
-
Returns an <type>integer</type>.
144
+
Returns an <type>int</type> on success, &return.falseforfailure;.
136
145
</para>
137
146
<para>
138
-
As <function>idate</function> always returns an <type>integer</type> and
147
+
As <function>idate</function> always returns an <type>int</type> and
139
148
as they can't start with a "0", <function>idate</function> may return
140
149
fewer digits than you would expect. See the example below.
141
150
</para>
...
...
@@ -160,9 +169,19 @@
160
169
</row>
161
170
</thead>
162
171
<tbody>
163
-
164
-
&date.timezone.errors.changelog;
165
-
172
+
<row>
173
+
<entry>8.2.0</entry>
174
+
<entry>
175
+
Adds the <literal>N</literal> (ISO-8601 day of the week) and
176
+
<literal>o</literal> (ISO-8601 year) format characters.
177
+
</entry>
178
+
</row>
179
+
<row>
180
+
<entry>8.0.0</entry>
181
+
<entry>
182
+
<parameter>timestamp</parameter> is nullable now.
183
+
</entry>
184
+
</row>
166
185
</tbody>
167
186
</tgroup>
168
187
</informaltable>
...
...
@@ -194,6 +213,7 @@ echo idate('y', $timestamp);
194
213
&reftitle.seealso;
195
214
<para>
196
215
<simplelist>
216
+
<member><methodname>DateTimeInterface::format</methodname></member>
197
217
<member><function>date</function></member>
198
218
<member><function>getdate</function></member>
199
219
<member><function>time</function></member>
...
...
@@ -201,7 +221,6 @@ echo idate('y', $timestamp);
201
221
</para>
202
222
</refsect1>
203
223
</refentry>
204
-

205
224
<!-- Keep this comment at the end of the file
206
225
Local variables:
207
226
mode: sgml
208
227