I wrote this function
function formatted_month($month) {
$first_day_in_month = new DateTime('2022-01-01');
$fmt = datefmt_create(
'en_EN',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Europe/Paris',
IntlDateFormatter::GREGORIAN,
'MMMM YY'
);
$formatted_month = datefmt_format($fmt,$first_day_in_month);
return $formatted_month;
}
This return January 22 as expected but this code :
function formatted_month($month) {
$first_day_in_month = new DateTime('2022-01-01');
$fmt = datefmt_create(
'fr_FR',
IntlDateFormatter::FULL,
IntlDateFormatter::FULL,
'Europe/Paris',
IntlDateFormatter::GREGORIAN,
'MMMM YY'
);
$formatted_month = datefmt_format($fmt,$first_day_in_month);
return $formatted_month;
}
Return janvier 21. The only difference is this line
'en_EN', -> 'fr_FR'
Same thing for es_ES and non English languages...
Do you have any explanation ? Thanks