xref: /PHP-7.1/ext/date/tests/bug72096.phpt (revision b224e742)
1--TEST--
2Bug #72096: Swatch time value incorrect for dates before 1970
3--INI--
4date.timezone=UTC
5--FILE--
6<?php
7for ($unix = 1461283200; $unix <= 1461369600; $unix += 8000) {
8	echo "Time:", gmdate('Y-m-d H:i:s = B', $unix), PHP_EOL;
9	echo "Time:", gmdate('Y-m-d H:i:s = B', $unix - 82 * 365 * 24 * 3600), PHP_EOL;
10}
11?>
12--EXPECT--
13Time:2016-04-22 00:00:00 = 041
14Time:1934-05-13 00:00:00 = 041
15Time:2016-04-22 02:13:20 = 134
16Time:1934-05-13 02:13:20 = 134
17Time:2016-04-22 04:26:40 = 226
18Time:1934-05-13 04:26:40 = 226
19Time:2016-04-22 06:40:00 = 319
20Time:1934-05-13 06:40:00 = 319
21Time:2016-04-22 08:53:20 = 412
22Time:1934-05-13 08:53:20 = 412
23Time:2016-04-22 11:06:40 = 504
24Time:1934-05-13 11:06:40 = 504
25Time:2016-04-22 13:20:00 = 597
26Time:1934-05-13 13:20:00 = 597
27Time:2016-04-22 15:33:20 = 689
28Time:1934-05-13 15:33:20 = 689
29Time:2016-04-22 17:46:40 = 782
30Time:1934-05-13 17:46:40 = 782
31Time:2016-04-22 20:00:00 = 875
32Time:1934-05-13 20:00:00 = 875
33Time:2016-04-22 22:13:20 = 967
34Time:1934-05-13 22:13:20 = 967
35