1--TEST-- 2IntlTimeZone::toDateTimeZone(): basic test 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/Lisbon'); 10 11function do_test(IntlTimeZone $tz, $proc = false) { 12 var_dump($tz->getID(), $tz->getRawOffset()); 13 if (!$proc) 14 $dtz = $tz->toDateTimeZone(); 15 else 16 $dtz = intltz_to_date_time_zone($tz); 17 var_dump($dtz->getName(), $dtz->getOffset(new DateTime('2012-01-01 00:00:00'))); 18} 19 20do_test(IntlTimeZone::createTimeZone('CET')); 21do_test(IntlTimeZone::createTimeZone('Europe/Amsterdam')); 22do_test(IntlTimeZone::createTimeZone('GMT+0405'), true); 23?> 24--EXPECTF-- 25string(3) "CET" 26int(3600000) 27string(%d) "%rEurope\/Berlin|CET%r" 28int(3600) 29string(16) "Europe/Amsterdam" 30int(3600000) 31string(16) "Europe/Amsterdam" 32int(3600) 33string(%s) "GMT+04%s5" 34int(14700000) 35string(6) "+04:05" 36int(14700) 37