Bug #74671 [Opn->Nab]: DST timezone abbreviation has incorrect offset
| From: | cmb@php.net | Date: | Tue, 30 May 2017 09:14:21 +0000 |
| Subject: | Bug #74671 [Opn->Nab]: DST timezone abbreviation has incorrect offset | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209300@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74671&edit=1
ID: 74671
Updated by: cmb@php.net
Reported by: ewgenij dot starostin at fondsnet dot de
Summary: DST timezone abbreviation has incorrect offset
-Status: Open
+Status: Not a bug
Type: Bug
Package: Date/time related
Operating System: Linux
PHP Version: 7.1.5
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
From the docs[1]:
| The behavior of timezones not listed here is undefined.
[1] <http://php.net/manual/en/timezones.php>
Previous Comments:
------------------------------------------------------------------------
[2017-05-29 14:17:26] ewgenij dot starostin at fondsnet dot de
Description:
------------
When using a timezone abbreviation (e. g. CEST) instead of a geographical timezone name (e. g.
Europe/Berlin) in the DateTimeZone constructor, the resulting time offset is that of the
corresponding non-DST timezone, coming up an hour short.
https://3v4l.org/VTI3C
Test script:
---------------
$dt = new DateTime(
'2017-05-16T10:11:32',
new DateTimeZone('CEST')
);
var_dump($dt);
var_dump($dt->format('c'));
Expected result:
----------------
object(DateTime)#1 (3) {
["date"]=>
string(26) "2017-05-16 10:11:32.000000"
["timezone_type"]=>
int(2)
["timezone"]=>
string(4) "CEST"
}
string(25) "2017-05-16T10:11:32+02:00"
Actual result:
--------------
object(DateTime)#1 (3) {
["date"]=>
string(26) "2017-05-16 10:11:32.000000"
["timezone_type"]=>
int(2)
["timezone"]=>
string(4) "CEST"
}
string(25) "2017-05-16T10:11:32+01:00"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74671&edit=1