1--TEST--
2IntlDateFormatter::formatObject(): DateTime 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$dt = new DateTime('2012-01-01 00:00:00'); //Europe/Lisbon
15echo IntlDateFormatter::formatObject($dt), "\n";
16echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n";
17echo IntlDateFormatter::formatObject($dt, null, "en-US"), "\n";
18echo IntlDateFormatter::formatObject($dt, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n";
19echo IntlDateFormatter::formatObject($dt, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n";
20
21$dt = new DateTime('2012-01-01 05:00:00+03:00');
22echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n";
23
24?>
25==DONE==
26--EXPECTF--
2701/01/2012, 00:00:00
28domingo, 1 de Janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental
29Jan 1, 2012, 12:00:00 AM
301/1/12, 12:00:00 AM Western European Standard %STime
31Sun 2012-01-1 00,00,00.000 Portugal Time
32domingo, 1 de Janeiro de 2012 às 05:00:00 GMT+03:00
33==DONE==
34