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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Tue Oct 08 12:01:26 2024 UTC