Annotation of embedaddon/php/ext/date/tests/bug43003.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #43003 (Invalid timezone reported for DateTime objects constructed using a timestamp)
3: --FILE--
4: <?php
5: date_default_timezone_set('Europe/Oslo');
6:
7: $oDateTest = new DateTime("@0", new DateTimeZone(date_default_timezone_get()));
8: echo $oDateTest->getTimezone()->getName().": " . $oDateTest->format("Y-m-d H:i:s")."\n";
9:
10: $oDateTest->setTimezone(new DateTimeZone("UTC"));
11: echo $oDateTest->getTimezone()->getName().": " . $oDateTest->format("Y-m-d H:i:s")."\n";
12:
13: $oDateTest->setTimezone(new DateTimeZone(date_default_timezone_get()));
14: echo $oDateTest->getTimezone()->getName().": " . $oDateTest->format("Y-m-d H:i:s")."\n";
15:
16: $oDateTest = new DateTime("@0");
17: echo $oDateTest->getTimezone()->getName().": " . $oDateTest->format("Y-m-d H:i:s")."\n";
18:
19: $oDateTest->setTimezone( new DateTimeZone(date_default_timezone_get()));
20: echo $oDateTest->getTimezone()->getName().": " . $oDateTest->format("Y-m-d H:i:s")."\n";
21: ?>
22: --EXPECT--
23: +00:00: 1970-01-01 00:00:00
24: UTC: 1970-01-01 00:00:00
25: Europe/Oslo: 1970-01-01 01:00:00
26: +00:00: 1970-01-01 00:00:00
27: Europe/Oslo: 1970-01-01 01:00:00
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>