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