Bug #80995 [NEW]: Europe DateTimeZone bug in specific DateTime interval

From: Date: Tue, 27 Apr 2021 13:33:16 +0000
Subject: Bug #80995 [NEW]: Europe DateTimeZone bug in specific DateTime interval
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233589@lists.php.net to get a copy of this message
From:             loic dot geny at gmail dot com
Operating system: Ubuntu 20.04.2 LTS
PHP version:      7.4.16
Package:          Date/time related
Bug Type:         Bug
Bug description:Europe DateTimeZone bug in specific DateTime interval

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 bug report at https://bugs.php.net/bug.php?id=80995&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80995&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80995&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80995&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80995&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80995&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80995&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80995&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80995&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80995&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80995&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80995&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80995&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80995&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80995&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80995&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80995&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80995&r=mysqlcfg


Thread (7 messages)

« previous php.bugs (#233589) next »