Annotation of embedaddon/php/ext/date/tests/bug45543.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test for bug #45543: DateTime::setTimezone can not set timezones without ID.
3: --INI--
4: date.timezone=UTC
5: --FILE--
6: <?php
7: $test_dates = array(
8: '2008-01-01 12:00:00 PDT',
9: '2008-01-01 12:00:00 +02:00',
10: );
11:
12: foreach ($test_dates as $test_date)
13: {
14: $d1 = new DateTime($test_date);
15: $d2 = new DateTime('2008-01-01 12:00:00 UTC');
16: echo $d1->format(DATE_ISO8601), PHP_EOL;
17: echo $d2->format(DATE_ISO8601), PHP_EOL;
18: $tz = $d1->getTimeZone();
19: $d2->setTimeZone($tz);
20: echo $d1->format(DATE_ISO8601), PHP_EOL;
21: echo $d2->format(DATE_ISO8601), PHP_EOL;
22: echo PHP_EOL;
23: }
24: --EXPECT--
25: 2008-01-01T12:00:00-0700
26: 2008-01-01T12:00:00+0000
27: 2008-01-01T12:00:00-0700
28: 2008-01-01T05:00:00-0700
29:
30: 2008-01-01T12:00:00+0200
31: 2008-01-01T12:00:00+0000
32: 2008-01-01T12:00:00+0200
33: 2008-01-01T14:00:00+0200
34:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>