1--TEST--
2IntlDateFormatter::formatObject(): IntlCalendar tests
3--SKIPIF--
4<?php
5if (!extension_loaded('intl')) die('skip intl extension not enabled'); ?>
6<?php if (version_compare(INTL_ICU_VERSION, '52.1') < 0) die('skip for ICU >= 52.1'); ?>
7<?php if (version_compare(INTL_ICU_VERSION, '54.1') >=  0) die('skip for ICU < 54.1'); ?>
8--FILE--
9<?php
10ini_set("intl.error_level", E_WARNING);
11ini_set("intl.default_locale", "pt_PT");
12ini_set("date.timezone", "Europe/Lisbon");
13
14$cal = IntlCalendar::fromDateTime('2012-01-01 00:00:00'); //Europe/Lisbon
15echo IntlDateFormatter::formatObject($cal), "\n";
16echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n";
17echo IntlDateFormatter::formatObject($cal, null, "en-US"), "\n";
18echo IntlDateFormatter::formatObject($cal, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n";
19echo IntlDateFormatter::formatObject($cal, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n";
20
21$cal = IntlCalendar::fromDateTime('2012-01-01 05:00:00+03:00');
22echo datefmt_format_object($cal, IntlDateFormatter::FULL), "\n";
23
24$cal = IntlCalendar::createInstance(null,'en-US@calendar=islamic-civil');
25$cal->setTime(strtotime('2012-01-01 00:00:00')*1000.);
26echo IntlDateFormatter::formatObject($cal), "\n";
27echo IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL, "en-US"), "\n";
28
29?>
30==DONE==
31
32--EXPECTF--
3301/01/2012, 00:00:00
34domingo, 1 de Janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental
35Jan 1, 2012, 12:00:00 AM
361/1/12, 12:00:00 AM Western European Standard %STime
37Sun 2012-01-1 00,00,00.000 Portugal Time
38domingo, 1 de Janeiro de 2012 às 05:00:00 GMT+03:00
3906/02/1433, 00:00:00
40Sunday, Safar 6, 1433 at 12:00:00 AM Western European Standard Time
41==DONE==
42