[php-src] Issue #11206: IntlDateFormatter in pt_PT locale has invalid date and time separator when used IntlDateFormatter::FULL and
IntlDateFormatter::LONG formats
| From: | Flower7C3 | Date: | Mon, 08 May 2023 10:09:56 +0000 |
| Subject: | [php-src] Issue #11206: IntlDateFormatter in pt_PT locale has invalid date and time separator when used IntlDateFormatter::FULL and IntlDateFormatter::LONG formats |
||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-244399@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11206
Author: Flower7C3
### Description
The following code:
```php
<?php
foreach ([IntlDateFormatter::FULL, IntlDateFormatter::LONG, IntlDateFormatter::MEDIUM,
IntlDateFormatter::SHORT] as $format) {
$zone = new DateTimeZone('Europe/Lisbon');
$formatter = new IntlDateFormatter('pt_PT', $format, $format);
$time = new DateTime('2023-05-11 20:00:00', $zone);
$formatter->setTimeZone($time->getTimezone());
echo $formatter->format($time) . PHP_EOL;
}
```
Resulted in this output:
```
Quinta-feira, 11 de Maio de 2023 à0 20:00:00 Hora de Verão da Europa Ocidental
11 de Maio de 2023 à0 20:00:00 WEST
11/05/2023, 20:00:00
11/05/23, 20:00
```
But I expected this output instead:
```
Quinta-feira, 11 de Maio de 2023 às 20:00:00 Hora de Verão da Europa Ocidental
11 de Maio de 2023 às 20:00:00 WEST
11/05/2023, 20:00:00
11/05/23, 20:00
```
Valid separator is defined in source code https://github.com/unicode-org/icu/blob/d469e628f391d1d464e980eb257c595fdb5a2a3a/icu4c/source/data/locales/pt.txt#L416-L421
### PHP Version
8.2.5, 8.1.18, 8.0.28, 7.4.33, 7.3.33
### Operating System
_No response_