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