xref: /PHP-7.1/ext/date/tests/bug32086.phpt (revision cf60f26d)
1--TEST--
2Bug #32086 (strtotime don't work in DST)
3--INI--
4date.timezone=America/Sao_Paulo
5--FILE--
6<?php
7
8echo $g = strtotime("2004-11-01"), "\n";
9echo $i = strtotime("2004-11-01 +1 day"), "\n";
10echo $j = strtotime("+1 day", $g), "\n";
11echo $k = strtotime("2004-11-02"), "\n";
12echo $l = strtotime("2004-11-03"), "\n";
13echo date("Y-m-d H:i:s T\n", $g);
14echo date("Y-m-d H:i:s T\n", $i);
15echo date("Y-m-d H:i:s T\n", $j);
16echo date("Y-m-d H:i:s T\n", $k);
17echo date("Y-m-d H:i:s T\n", $l);
18
19echo $g = strtotime("2005-02-19"), "\n";
20echo $i = strtotime("2005-02-19 +1 day"), "\n";
21echo $j = strtotime("+1 day", $g), "\n";
22echo $k = strtotime("2005-02-20"), "\n";
23echo $l = strtotime("2005-02-21"), "\n";
24echo date("Y-m-d H:i:s T\n", $g);
25echo date("Y-m-d H:i:s T\n", $i);
26echo date("Y-m-d H:i:s T\n", $j);
27echo date("Y-m-d H:i:s T\n", $k);
28echo date("Y-m-d H:i:s T\n", $l);
29
30?>
31--EXPECT--
321099278000
331099364400
341099364400
351099364400
361099447200
372004-11-01 00:00:00 -03
382004-11-02 01:00:00 -02
392004-11-02 01:00:00 -02
402004-11-02 01:00:00 -02
412004-11-03 00:00:00 -02
421108778400
431108868400
441108868400
451108868400
461108954800
472005-02-19 00:00:00 -02
482005-02-20 00:00:00 -03
492005-02-20 00:00:00 -03
502005-02-20 00:00:00 -03
512005-02-21 00:00:00 -03
52