Skip to content

Commit e5b4624

Browse files
committed
Fixed #9165: strtotime translates a date-time with DST/non-DST hour differently based on default timezone
1 parent 4a52022 commit e5b4624

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ PHP NEWS
1010
. Fixed bug GH-9447 (Invalid class FQN emitted by AST dump for new and class
1111
constants in constant expressions). (ilutov)
1212

13+
- Date:
14+
. Fixed bug GH-9165 (strtotime translates a date-time with DST/non-DST hour
15+
differently based on default timezone). (Derick)
16+
1317
- DOM:
1418
. Fixed bug #79451 (DOMDocument->replaceChild on doctype causes double free).
1519
(Nathan Freeman)

ext/date/tests/gh9165.phpt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
GH-9165 (strtotime translates a date-time with DST/non-DST hour differently based on default timezone)
3+
--FILE--
4+
<?php
5+
date_default_timezone_set('America/Lower_Princes');
6+
echo strtotime("2018-10-28 01:00:00 Europe/London") . PHP_EOL;
7+
8+
date_default_timezone_set('Europe/London');
9+
echo strtotime("2018-10-28 01:00:00 Europe/London"). PHP_EOL;
10+
11+
date_default_timezone_set('America/Lower_Princes');
12+
echo strtotime("2018-10-28 04:00:00 Europe/London") . PHP_EOL;
13+
14+
date_default_timezone_set('Europe/London');
15+
echo strtotime("2018-10-28 04:00:00 Europe/London"). PHP_EOL;
16+
?>
17+
--EXPECT--
18+
1540684800
19+
1540684800
20+
1540699200
21+
1540699200

0 commit comments

Comments
 (0)