Bug #77741 [Opn]: DateTimeZone/setTimezone returns wrong values
| From: | girgias@php.net | Date: | Sat, 16 Mar 2019 15:31:08 +0000 |
| Subject: | Bug #77741 [Opn]: DateTimeZone/setTimezone returns wrong values | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-220008@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77741&edit=1
ID: 77741
Updated by: girgias@php.net
Reported by: info at akebono dot nl
Summary: DateTimeZone/setTimezone returns wrong values
Status: Open
Type: Bug
Package: Date/time related
Operating System: Windows 10
PHP Version: 7.2.16
-Assigned To:
+Assigned To: derick
Block user comment: N
Private report: N
New Comment:
Seems like PHP assumes the transition from Standard time to Summertime occurs at the same time which
is not the case with EU/USA.
Can you confirm this @derick?
Previous Comments:
------------------------------------------------------------------------
[2019-03-14 12:32:09] info at akebono dot nl
Description:
------------
Wrong value output. It does not matter whether TimeZoneNameFrom is set to PST or PDT.
Test script:
---------------
TimeZoneNameFrom = 'PST';
TimeZoneNameTo = 'Europe/Amsterdam';
TimeStr = '2019-3-20 23:59:00';
$convertedTime = date_create($TimeStr, new DateTimeZone($TimeZoneNameFrom))->setTimezone(new
DateTimeZone($TimeZoneNameTo))->format("j F H.i");
Expected result:
----------------
21 March 07.59 CET
Actual result:
--------------
21 March 08.59 CET
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77741&edit=1