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
 [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: Sat Dec 21 12:01:31 2024 UTC