<?php
$tz = new DateTimeZone('Europe/Moscow');
$now = time();
foreach (['en_US', 'ja_JA', 'ru_RU'] as $locale) {
printf("%s:\n", $locale);
foreach ([IntlDateFormatter::MEDIUM, IntlDateFormatter::LONG] as $datetype) {
$formatter = new IntlDateFormatter($locale, $datetype, IntlDateFormatter::NONE);
printf("- %s\n", $formatter->format($now));
}
}
- Output for 5.5.17, 5.6.0 - 5.6.38, 7.0.0 - 7.0.32, 7.1.0 - 7.1.24, 7.2.0 - 7.2.12, 7.4.23 - 7.4.27, 8.1.0 - 8.1.20, 8.2.10
- en_US:
- Feb 1, 2016
- February 1, 2016
ja_JA:
- 2016/02/01
- 2016年2月1日
ru_RU:
- 1 февр. 2016 г.
- 1 февраля 2016 г.
- Output for 5.5.0 - 5.5.16, 5.5.18 - 5.5.38
- en_US:
Fatal error: Class 'IntlDateFormatter' not found in /in/iJOT4 on line 8
Process exited with code 255.
preferences:
132.93 ms | 402 KiB | 159 Q