Closed
Description
Symfony version(s) affected
6.0.3
Description
I'm using Timezones like this:
Timezones::getGmtOffset('Europe/Paris', (new DateTime('2022-02-16 00:00:00'))->getTimestamp()); // result: GMT+02:00
But when I'm looking on google I got this:
It's not the same GMT.
In the documentation example it take the "time change" correctly for Madrid:
$offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 27, 2019')); // $offset = 'GMT+02:00' $offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019')); // $offset = 'GMT+01:00'
But when I try it I got:
$offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 27, 2019')); // $offset = 'GMT+02:00'
$offset = Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019')); // $offset = 'GMT+02:00'
How to reproduce
<?php
use Symfony\Component\Intl\Timezones;
class OffsetClass
{
public static function getOffsetGmt(): bool
{
return
Timezones::getGmtOffset('Europe/Madrid', strtotime('October 27, 2019'))
!==
Timezones::getGmtOffset('Europe/Madrid', strtotime('October 28, 2019'));
}
}
OffsetClass::getOffsetGmt();
Possible Solution
No response
Additional Context
I'm running my symfony application in a docker FROM php:8.1-fpm-alpine