xref: /PHP-5.4/ext/date/tests/bug45529.phpt (revision a9e5e222)
1--TEST--
2Bug #45529 (UTC not properly recognised as timezone identifier while parsing)
3--FILE--
4<?php
5date_default_timezone_set('Europe/Oslo');
6$tz1 = new DateTimeZone('UTC');
7$tz2 = date_create('UTC')->getTimeZone();
8echo $tz1->getName(), PHP_EOL;
9echo $tz2->getName(), PHP_EOL;
10$d = new DateTime('2008-01-01 12:00:00+0200');
11$d->setTimeZone($tz1);
12echo $d->format(DATE_ISO8601), PHP_EOL;
13$d = new DateTime('2008-01-01 12:00:00+0200');
14$d->setTimeZone($tz2);
15echo $d->format(DATE_ISO8601), PHP_EOL;
16?>
17--EXPECT--
18UTC
19UTC
202008-01-01T10:00:00+0000
212008-01-01T10:00:00+0000
22