xref: /PHP-8.0/ext/date/tests/bug62561.phpt (revision b3469560)
1--TEST--
2Bug #62561 Unixtimestamp may take on local times DST flag (this test will only be valid during EDT)
3--FILE--
4<?php
5$tz = new DateTimeZone('America/New_York');
6$ts = new DateTime('@1341115200', $tz);
7$int = new DateInterval('P1D');
8$dayFromTs = new DateTime('@1341115200', new DateTimeZone('America/New_York'));
9$dayFromTs->add($int);
10
11echo 'ts: '.$ts->format('Y-m-d H:i:s')."\n";
12echo 'day from ts: '.$dayFromTs->format('Y-m-d H:i:s')."\n";
13?>
14--EXPECT--
15ts: 2012-07-01 04:00:00
16day from ts: 2012-07-02 04:00:00
17