On my Windows development machine, I have set the locale to ita
:
setlocale(LC_TIME, \'ita\');
echo strft
Quite ugly, but it works:
$formatter = \IntlDateFormatter::create(
'it',
\IntlDateFormatter::LONG,
\IntlDateFormatter::NONE,
\DateTimeZone::UTC, // Doesn't matter
\IntlDateFormatter::GREGORIAN,
'MMM'
);
$months = array_map(
function($m) use($formatter){
return $formatter->format(mktime(0, 0, 0, $m, 2, 1970));
},
range(1, 12)
);
var_dump($months);
Strange thing is with it
month names are lower case, with en
they have the right case. I'll leave the question unanswered looking for a better solution!