3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* default timezone is irrelevant; timezone taken from the object */ ini_set('date.timezone', 'UTC'); /* default locale is taken from this ini setting */ ini_set('intl.default_locale', 'fr_FR'); $cal = IntlCalendar::fromDateTime("2013-06-06 17:05:06 Europe/Dublin"); echo "default:\n\t", IntlDateFormatter::formatObject($cal), "\n"; echo "long \$format (full):\n\t", IntlDateFormatter::formatObject($cal, IntlDateFormatter::FULL), "\n"; echo "array \$format (none, full):\n\t", IntlDateFormatter::formatObject($cal, array( IntlDateFormatter::NONE, IntlDateFormatter::FULL)), "\n"; echo "string \$format (d 'of' MMMM y):\n\t", IntlDateFormatter::formatObject($cal, "d 'of' MMMM y", 'en_US'), "\n"; echo "with DateTime:\n\t", IntlDateFormatter::formatObject( new DateTime("2013-09-09 09:09:09 Europe/Madrid"), IntlDateFormatter::FULL, 'es_ES'), "\n";

preferences:
45.1 ms | 402 KiB | 5 Q