This question already has an answer here:
- php strftime French characters 9 answers
I have this code in PHP to translate dates to their locale
$date = time();
$locale_code = 'en_NZ';
$format_full_date = '%e %B %Y at %l:%M %P'; // 21 August 2013 at 3:26 am
// Set locale
setlocale(LC_ALL, $locale_code);
// Get date
$locale_date = strftime(lang('format_full_date'), $date);
// Reset locale
setlocale(LC_ALL, 0);
This works fine in en_NZ
. The output is something like 21 August 2013 at 8:26 pm
But when I change locale_code to fr_CA
, I get outputted 21 ao�t 2013 at 8:26
There are two problems here
- Why is the French
August
translation garbled? - Why is am/pm not showing?
</div>