[php-src] Issue #8108: PHP 8.1 Timezone doesn't work as intended
| From: | heiglandreas | Date: | Thu, 17 Feb 2022 13:00:45 +0000 |
| Subject: | [php-src] Issue #8108: PHP 8.1 Timezone doesn't work as intended | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-239844@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8108
Comment Author: heiglandreas
If you want the offset for a specific point in time I'd recommend using
DateTimeImmutable::getOffset() instead.
```php
echo (new DateTimeImmutable('Europe/Paris'))->getOffset();
// 3600
```
https://3v4l.org/LXVYV
Much more concerning is to me, that PHP8.1 does not seem to return an array of Transitions at all
any more.
Code:
```php
$a = new DateTimeImmutable('2022-02-17T12:00:00 Europe/Paris');
$b = $a->add(new Dateinterval('P12M'));
var_Dump($a, $b, (new
DateTimezone('Europe/Paris'))->getTransitions($a->getTimestamp(),
$b->getTimestamp()));
```
expected Outcome: an array with three transitions
actual Output in PHP8.1: An array with one entry.
See https://3v4l.org/FSAmO