1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fixed bug #74671 (DST timezone abbreviation has incorrect offset)

This commit is contained in:
Derick Rethans
2022-05-20 15:28:15 +01:00
parent b90201745f
commit 6418eba1cd
2 changed files with 22 additions and 0 deletions

View File

@@ -3427,6 +3427,7 @@ static int timezone_initialize(php_timezone_obj *tzobj, const char *tz, size_t t
}
dummy_t->z = timelib_parse_zone(&tz, &dst, dummy_t, &not_found, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
dummy_t->dst = dst;
if (not_found) {
php_error_docref(NULL, E_WARNING, "Unknown or bad timezone (%s)", orig_tz);
efree(dummy_t);

View File

@@ -0,0 +1,21 @@
--TEST--
Bug #74671 (DST timezone abbreviation has incorrect offset)
--FILE--
<?php
$dt = new DateTime(
'2017-05-16T10:11:32',
new DateTimeZone('CEST')
);
var_dump($dt);
var_dump($dt->format('c'));
?>
--EXPECTF--
object(DateTime)#%d (%d) {
["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"