Skip to content

Commit

Permalink
Fixed #9165: strtotime translates a date-time with DST/non-DST hour d…
Browse files Browse the repository at this point in the history
…ifferently based on default timezone
  • Loading branch information
derickr committed Sep 14, 2022
1 parent 4a52022 commit e5b4624
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ PHP NEWS
. Fixed bug GH-9447 (Invalid class FQN emitted by AST dump for new and class
constants in constant expressions). (ilutov)

- Date:
. Fixed bug GH-9165 (strtotime translates a date-time with DST/non-DST hour
differently based on default timezone). (Derick)

- DOM:
. Fixed bug #79451 (DOMDocument->replaceChild on doctype causes double free).
(Nathan Freeman)
Expand Down
21 changes: 21 additions & 0 deletions ext/date/tests/gh9165.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
--TEST--
GH-9165 (strtotime translates a date-time with DST/non-DST hour differently based on default timezone)
--FILE--
<?php
date_default_timezone_set('America/Lower_Princes');
echo strtotime("2018-10-28 01:00:00 Europe/London") . PHP_EOL;

date_default_timezone_set('Europe/London');
echo strtotime("2018-10-28 01:00:00 Europe/London"). PHP_EOL;

date_default_timezone_set('America/Lower_Princes');
echo strtotime("2018-10-28 04:00:00 Europe/London") . PHP_EOL;

date_default_timezone_set('Europe/London');
echo strtotime("2018-10-28 04:00:00 Europe/London"). PHP_EOL;
?>
--EXPECT--
1540684800
1540684800
1540699200
1540699200

0 comments on commit e5b4624

Please sign in to comment.