Skip to content

Commit dcf89d1

Browse files
📝 Document Y format footgun (php#4926)
Updated descriptions for `Y` format to clearly shows that 2 digit years may lead to unexpected results.
1 parent 3a97501 commit dcf89d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

reference/datetime/datetimeimmutable/createfromformat.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
</row>
170170
<row>
171171
<entry><literal>X</literal> and <literal>x</literal></entry>
172-
<entry>A full numeric representation of a year, up to 19 digits,
172+
<entry>A full numeric representation of a year, <emphasis>up to</emphasis> 19 digits,
173173
optionally prefixed by <literal>+</literal> or
174174
<literal>-</literal></entry>
175175
<entry>Examples: <literal>0055</literal>, <literal>787</literal>,
@@ -178,9 +178,9 @@
178178
</row>
179179
<row>
180180
<entry><literal>Y</literal></entry>
181-
<entry>A full numeric representation of a year, up to 4 digits</entry>
182-
<entry>Examples: <literal>0055</literal>, <literal>787</literal>,
183-
<literal>1999</literal>, <literal>2003</literal></entry>
181+
<entry>A full numeric representation of a year, <emphasis>up to</emphasis> 4 digits</entry>
182+
<entry>Examples: <literal>25</literal> (same as <literal>0025</literal>),
183+
<literal>787</literal>, <literal>1999</literal>, <literal>2003</literal></entry>
184184
</row>
185185
<row>
186186
<entry><literal>y</literal></entry>

0 commit comments

Comments
 (0)