php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70086 DateTimeZone object doesn't calculate the offset correctly for some timezones
Submitted: 2015-07-16 08:57 UTC Modified: 2015-07-16 11:00 UTC
From: tunderzone at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: Date/time related
PHP Version: 5.6.11 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tunderzone at gmail dot com
New email:
PHP Version: OS:

 

 [2015-07-16 08:57 UTC] tunderzone at gmail dot com
Description:
------------
DateTimeZone object doesn't calculate the offset correctly.

php > echo phpversion();
5.6.11
php > $timezone = new DateTimeZone('EEST');
php > $date = new DateTime('2015-07-16', new DateTimeZone('Europe/Bucharest'));
php > echo $date->format('T P');
EEST +03:00
php > $date->setTimezone($timezone);
php > echo $date->format('T P');
EEST +02:00

Test script:
---------------
<?php
$timezone = new DateTimeZone('EEST');
$date = new DateTime('2015-07-16', new DateTimeZone('Europe/Bucharest'));
$date->setTimezone($timezone);
echo $date->format('T P');

Expected result:
----------------
EEST +03:00

Actual result:
--------------
EEST +02:00

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-16 11:00 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2015-07-16 11:00 UTC] cmb@php.net
Duplicate of bug #69916.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 20:01:28 2024 UTC