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
27--EXPECTF--
2801/01/2012, 00:00:00
29domingo, 1 de janeiro de 2012 às 00:00:00 Hora Padrão %Sda Europa Ocidental
30Jan 1, 2012, 12:00:00 AM
311/1/12, 12:00:00 AM Western European Standard %STime
32Sun 2012-01-1 00,00,00.000 Portugal Time
33domingo, 1 de janeiro de 2012 às 05:00:00 GMT+03:00
34==DONE==
35