|  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
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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2019-03-16 15:31 UTC]
-Assigned To: +Assigned To: derick
 [2019-03-16 15:31 UTC]
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-2021 The PHP Group
All rights reserved.
Last updated: Sun Aug 01 21:01:24 2021 UTC