We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5537c5f commit e61b19aCopy full SHA for e61b19a
reference/datetime/formats.xml
@@ -556,9 +556,15 @@ object(DateTimeImmutable)#1 (3) {
556
557
<note>
558
<para>
559
- The "Year (and just the year)" format only works if a time string
560
- has already been found -- otherwise this format is recognised as
561
- <literal>HH</literal> <literal>MM</literal>.
+ The "Year (and just the year)" format only reliably works if a time string
+ has already been found. Otherwise, if the four digit year matches
+ <literal>HH</literal> <literal>MM</literal> then these two date elements
562
+ are set instead.
563
+ </para>
564
+ <para>
565
+ To consistently parse just a year, use
566
+ <function>DateTimeImmutable::createFromFormat</function> with the
567
+ <literal>Y</literal> specifier.
568
</para>
569
</note>
570
0 commit comments