Bug #74671 [Asn->Csd]: DST timezone abbreviation has incorrect offset

From: Date: Fri, 27 May 2022 13:29:19 +0000
Subject: Bug #74671 [Asn->Csd]: DST timezone abbreviation has incorrect offset
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-241606@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: git@php.net Reported by: ewgenij dot starostin at fondsnet dot de Summary: DST timezone abbreviation has incorrect offset -Status: Assigned +Status: Closed Type: Bug Package: Date/time related Operating System: Linux PHP Version: 7.1.5 Assigned To: derick Block user comment: N Private report: N New Comment: Automatic comment on behalf of derickr Revision: https://github.com/php/php-src/commit/6418eba1cd376b82e94a905bf10212126337bcd2 Log: Fixed bug #74671 (DST timezone abbreviation has incorrect offset) Previous Comments: ------------------------------------------------------------------------ [2022-05-20 14:31:25] derick@php.net https://github.com/php/php-src/pull/8595/files ------------------------------------------------------------------------ [2017-05-30 10:12:55] derick@php.net No, this is a bug. This should work properly. Although it should *not* adjust for DST changeovers. ------------------------------------------------------------------------ [2017-05-30 09:14:16] cmb@php.net 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> ------------------------------------------------------------------------ [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

« previous php.bugs (#241606) next »