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:
@@ -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, ¬_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);
|
||||
|
||||
21
ext/date/tests/bug74671.phpt
Normal file
21
ext/date/tests/bug74671.phpt
Normal 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"
|
||||
Reference in New Issue
Block a user