Bug #80831 [NEW]: IntlDateFormatter considers January 2021 days to be January 2020 days

From: Date: Thu, 04 Mar 2021 16:12:27 +0000
Subject: Bug #80831 [NEW]: IntlDateFormatter considers January 2021 days to be January 2020 days
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232559@lists.php.net to get a copy of this message
From: sebastian Operating system: Irrelevant PHP version: 8.0.3RC1 Package: Date/time related Bug Type: Bug Bug description:IntlDateFormatter considers January 2021 days to be January 2020 days 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" -- Edit bug report at https://bugs.php.net/bug.php?id=80831&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=80831&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=80831&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=80831&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=80831&r=needscript Try newer version: https://bugs.php.net/fix.php?id=80831&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=80831&r=support Expected behavior: https://bugs.php.net/fix.php?id=80831&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=80831&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=80831&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=80831&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=80831&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=80831&r=dst IIS Stability: https://bugs.php.net/fix.php?id=80831&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=80831&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=80831&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=80831&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=80831&r=mysqlcfg

« previous php.bugs (#232559) next »