php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #77741 DateTimeZone/setTimezone returns wrong values
Submitted: 2019-03-14 12:32 UTC Modified: 2019-03-16 15:31 UTC
From: info at akebono dot nl Assigned: derick (profile)
Status: Assigned Package: Date/time related
PHP Version: 7.2.16 OS: Windows 10
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2019-03-14 12:32 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-03-16 15:31 UTC] girgias@php.net
-Assigned To: +Assigned To: derick
 [2019-03-16 15:31 UTC] girgias@php.net
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?
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 01:01:28 2019 UTC