[php-src] Issue #13057: IntlDateFormater shows next year for the last day of year
| From: | msyk | Date: | Sun, 31 Dec 2023 02:37:11 +0000 |
| Subject: | [php-src] Issue #13057: IntlDateFormater shows next year for the last day of year | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-246158@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/13057
Author: msyk
### Description
I tried below, and result shows on each echo command. IntlDateFormater::format jumps to next year
for the DateTime object of '2023-12-31'. I think the last day of year doesn't handle
properly.
```php
<?php
$fmt = new IntlDateFormatter(
'ja_JP',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Asia/Tokyo',
IntlDateFormatter::GREGORIAN,
'Y-MM-dd'
);
echo $fmt->format(new DateTime('2023-12-30')); //2023-12-30 correct!
echo $fmt->format(new DateTime('2023-12-31')); //2024-12-31 omg!!
echo $fmt->format(new DateTime('2024-01-01')); //2024-01-01 correct!
### PHP Version
PHP 8.3.0
### Operating System
macOS Sonoma with HomeBrew