xref: /PHP-8.2/ext/date/tests/bug64992.phpt (revision 091c0920)
1--TEST--
2Bug #64992 (dst not handled past 2038)
3--FILE--
4<?php
5$firstyear = 2035;
6$lastyear = 2040;
7$tz = 'America/Los_Angeles';
8date_default_timezone_set('America/Los_Angeles');
9
10$dt = new DateTime((string) ($firstyear - 1) . "-07-02");
11$di = new DateInterval('P6M');
12
13for ($i = 0; $i < ($lastyear - $firstyear) * 2; $i++) {
14	$dt->add($di);
15	$gmto = $dt->getOffset();
16	echo "Time Zone offset for $tz for " , $dt->format('Y-m-d') , " is $gmto\n";
17}
18?>
19--EXPECT--
20Time Zone offset for America/Los_Angeles for 2035-01-02 is -28800
21Time Zone offset for America/Los_Angeles for 2035-07-02 is -25200
22Time Zone offset for America/Los_Angeles for 2036-01-02 is -28800
23Time Zone offset for America/Los_Angeles for 2036-07-02 is -25200
24Time Zone offset for America/Los_Angeles for 2037-01-02 is -28800
25Time Zone offset for America/Los_Angeles for 2037-07-02 is -25200
26Time Zone offset for America/Los_Angeles for 2038-01-02 is -28800
27Time Zone offset for America/Los_Angeles for 2038-07-02 is -25200
28Time Zone offset for America/Los_Angeles for 2039-01-02 is -28800
29Time Zone offset for America/Los_Angeles for 2039-07-02 is -25200
30