1--TEST--
2IntlCalendar::setTimeZone(): different ways to specify time zone
3--SKIPIF--
4<?php
5if (!extension_loaded('intl'))
6    die('skip intl extension not enabled');
7--FILE--
8<?php
9ini_set("intl.error_level", E_WARNING);
10ini_set("intl.default_locale", "nl");
11date_default_timezone_set('Europe/Amsterdam');
12
13$intlcal = new IntlGregorianCalendar();
14$intlcal->setTimeZone('Europe/Paris');
15var_dump($intlcal->getTimeZone()->getID());
16$intlcal->setTimeZone(new DateTimeZone('Europe/Madrid'));
17var_dump($intlcal->getTimeZone()->getID());
18
19$pstdate = new DateTime('2012-01-01 00:00:00 PST');
20$intlcal->setTimeZone($pstdate->getTimeZone());
21var_dump($intlcal->getTimeZone()->getID());
22
23$offsetdate = new DateTime('2012-01-01 00:00:00 -02:30');
24$intlcal->setTimeZone($offsetdate->getTimeZone());
25var_dump($intlcal->getTimeZone()->getID());
26?>
27--EXPECTF--
28string(12) "Europe/Paris"
29string(13) "Europe/Madrid"
30string(3) "PST"
31string(%d) "GMT-02%S30"
32