Working on a Wordpress theme that I had to convert the locale to french.
$data_event = get_post_meta($post->ID, 'event_date_interval', true);
$time = strtotime($data_event);
$pretty_date_yy = date('Y', $time);
setlocale (LC_ALL, "fr_FR");
$translate_fr = strftime("%h", strtotime($data_event));
$pretty_date_M = htmlentities($translate_fr);
$pretty_date_d = date('d', $time);
This works fine, it shows everything as it should (For example, right now we are in February so it shows FÉVR)
However my problem lies in that I want it to show FÉV. and not FÉVR. Is it possible to change this abbreviation?
EDIT: Solution was to create an array and set the specific names I wanted. It was not encoding properly utf8_encode was added. Thanks Phex!
$data_event = get_post_meta($post->ID, 'event_date_interval', true);
$time = strtotime($data_event);
setlocale (LC_ALL, "fr_FR");
$pretty_date_yy = date('Y', $time);
$pretty_date_d = date('d', $time);
$id = intval(strftime("%m", strtotime($data_event))) - 1;
$abr_map = array(
'Jan',
'Fév',
'Mar',
'Avr',
'Mai',
'Juin',
'Juil',
'Aout',
'Sept',
'Oct',
'Nov',
'Déc'
);
$translate_fr = htmlentities(utf8_decode($abr_map[$id]));
$pretty_date_M = $translate_fr;