[php-src] Issue #9740: IntlDateFormatter::formatObject wrong month if locale different from en_US (for january only)
| From: | SebNetbeans | Date: | Thu, 13 Oct 2022 11:17:31 +0000 |
| Subject: | [php-src] Issue #9740: IntlDateFormatter::formatObject wrong month if locale different from en_US (for january only) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242588@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9740
Author: SebNetbeans
### Description
var_dump(
'2022-01-01',
\IntlDateFormatter::formatObject(new \DateTime('2022-01-01'), 'MMM YYYY',
'en_US'),
\IntlDateFormatter::formatObject(new \DateTime('2022-01-01'), 'MMM YYYY',
'en_GB'),
\IntlDateFormatter::formatObject(new \DateTime('2022-01-01'), 'MMM YYYY',
'de_DE'),
\IntlDateFormatter::formatObject(new \DateTime('2022-01-01'), 'MMM YYYY',
'fr_FR')
);
Give results :
'2022-01-01'
'Jan 2022' -> OK
'Jan 2021' -> ERROR
'Jan. 2021' -> ERROR
'janv. 2021' -> ERROR
(Test for PHP 8.0 too, same error)
### PHP Version
PHP 8.1.11
### Operating System
Ubuntu 18.04