Bug #80995 [Opn->Fbk]: Europe DateTimeZone bug in specific DateTime interval
Edit report at https://bugs.php.net/bug.php?id=80995&edit=1
ID: 80995
Updated by: derick@php.net
Reported by: loic dot geny at gmail dot com
Summary: Europe DateTimeZone bug in specific DateTime
interval
-Status: Open
+Status: Feedback
Type: Bug
Package: Date/time related
Operating System: Ubuntu 20.04.2 LTS
PHP Version: 7.4.16
Block user comment: N
Private report: N
New Comment:
What is date.timezone set to? Please add that to your reproduce script.
Previous Comments:
------------------------------------------------------------------------
[2021-04-27 13:33:16] loic dot geny at gmail dot com
Description:
------------
IntlTimeZone::createTimeZone('Europe/Paris')->toDateTimeZone();
With date between 1940/01/01 and 1940/06/14, apply the DateTimeZone don't output the correct
DateTimeImmutable::format('Y-m-d)
Test script:
---------------
$timeZone = IntlTimeZone::createTimeZone('Europe/Paris')->toDateTimeZone();
$date = DateTimeImmutable::createFromFormat('Y-m-d H:i:s','1940-06-13
23:00:00');
$timeZonedDate = $date->setTimeZone($timeZone);
echo $timeZonedDate->format('Y-m-d');
$date = DateTimeImmutable::createFromFormat('Y-m-d H:i:s','1940-06-14
23:00:00');
$timeZonedDate = $date->setTimeZone($timeZone);
echo $timeZonedDate->format('Y-m-d');
Expected result:
----------------
Expected result :
'1940-06-14'
'1940-06-15'
Actual result:
--------------
Current result :
'1940-06-13'
'1940-06-15'
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80995&edit=1
Thread (7 messages)