1--TEST--
2IntlDateFormatter::formatObject(): DateTime tests
3--EXTENSIONS--
4intl
5--SKIPIF--
6<?php if (version_compare(INTL_ICU_VERSION, '72.1') < 0) die('skip for ICU < 72.1'); ?>
7--FILE--
8<?php
9ini_set("intl.error_level", E_WARNING);
10ini_set("intl.default_locale", "pt_PT");
11ini_set("date.timezone", "Europe/Lisbon");
12
13$dt = new DateTime('2012-01-01 00:00:00'); //Europe/Lisbon
14echo IntlDateFormatter::formatObject($dt), "\n";
15echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n";
16echo IntlDateFormatter::formatObject($dt, null, "en-US"), "\n";
17echo IntlDateFormatter::formatObject($dt, array(IntlDateFormatter::SHORT, IntlDateFormatter::FULL), "en-US"), "\n";
18echo IntlDateFormatter::formatObject($dt, 'E y-MM-d HH,mm,ss.SSS v', "en-US"), "\n";
19
20$dt = new DateTime('2012-01-01 05:00:00+03:00');
21echo IntlDateFormatter::formatObject($dt, IntlDateFormatter::FULL), "\n";
22
23?>
24--EXPECTF--
2501/01/2012, 00:00:00
26domingo, 1 de janeiro de 2012 às 00:00:00 Hora padrão %Sda Europa Ocidental
27Jan 1, 2012, 12:00:00 AM
281/1/12, 12:00:00 AM Western European Standard Time
29Sun 2012-01-1 00,00,00.000 Portugal Time
30domingo, 1 de janeiro de 2012 às 05:00:00 GMT+03:00
31