|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-03-04 16:20 UTC] derick@php.net
-Status: Open
+Status: Not a bug
[2021-03-04 16:20 UTC] derick@php.net
[2021-03-04 16:21 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 22:00:01 2025 UTC |
Description: ------------ I have DateTimeImmutable objects representing days/dates in January 2021. When I format these objects using an IntlDateFormatter object with the "MMMM Y" formatting string then the first three days of January 2021 are printed as January 2020. Test script: --------------- <?php declare(strict_types=1); $formatter = new IntlDateFormatter( 'de_DE', IntlDateFormatter::FULL, IntlDateFormatter::FULL, 'Europe/Berlin', IntlDateFormatter::GREGORIAN, 'MMMM Y' ); var_dump($formatter->format(new DateTimeImmutable('2021-01-01'))); var_dump($formatter->format(new DateTimeImmutable('2021-01-02'))); var_dump($formatter->format(new DateTimeImmutable('2021-01-03'))); var_dump($formatter->format(new DateTimeImmutable('2021-01-04'))); Expected result: ---------------- string(11) "Januar 2021" string(11) "Januar 2021" string(11) "Januar 2021" string(11) "Januar 2021" Actual result: -------------- string(11) "Januar 2020" string(11) "Januar 2020" string(11) "Januar 2020" string(11) "Januar 2021"