1--TEST--
2IntlDateFormatter: several forms of the timezone arg
3--SKIPIF--
4<?php
5if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
6<?php if (version_compare(INTL_ICU_VERSION, '51.2') < 0 || version_compare(INTL_ICU_VERSION, '52.1') >= 0) die('skip for ICU >= 51.2 and < 52.1'); ?>
7--FILE--
8<?php
9ini_set("intl.error_level", E_WARNING);
10ini_set("date.timezone", 'Atlantic/Azores');
11
12$ts = strtotime('2012-01-01 00:00:00 UTC');
13
14//should use Atlantic/Azores
15$df = new IntlDateFormatter('es_ES', 0, 0, NULL);
16echo $df->format($ts), "\n";
17
18$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam');
19echo $df->format($ts), "\n";
20
21$df = new IntlDateFormatter('es_ES', 0, 0, new DateTimeZone('Europe/Lisbon'));
22echo $df->format($ts), "\n";
23
24$df = new IntlDateFormatter('es_ES', 0, 0, IntlTimeZone::createTimeZone('America/New_York'));
25echo $df->format($ts), "\n";
26
27//time zone has priority
28$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', new IntlGregorianCalendar('Europe/Lisbon'));
29echo $df->format($ts), "\n";
30
31//calendar has priority
32$df = new IntlDateFormatter('es_ES', 0, 0, NULL, new IntlGregorianCalendar('Europe/Lisbon'));
33echo $df->format($ts), "\n";
34
35$df = new IntlDateFormatter('es_ES', 0, 0, 'Europe/Amsterdam', 0);
36echo $df->format($ts), "\n";
37
38--EXPECTF--
39sábado%S, 31 de diciembre de 2011 23:00:00 Hora estándar de las Azores
40domingo%S, 1 de enero de 2012 01:00:00 Hora estándar de Europa central
41domingo%S, 1 de enero de 2012 00:00:00 Hora%S de Europa occidental
42sábado%S, 31 de diciembre de 2011 19:00:00 Hora estándar oriental
43domingo%S, 1 de enero de 2012 01:00:00 Hora estándar de Europa central
44domingo%S, 1 de enero de 2012 00:00:00 Hora%S de Europa occidental
45domingo%S, 1 de enero de 2012 01:00:00 Hora estándar de Europa central
46