I am working on a PHP code in which I want to display month name in French.
<?php
if (false !== strpos($translated_tz['diff'], '-')) {
$ts = date_sub($altered_timestamp, date_interval_create_from_date_string($translated_tz['diff']));
} else {
$ts = date_add($altered_timestamp, date_interval_create_from_date_string($translated_tz['diff']));
}
?>
<?php if (ICL_LANGUAGE_CODE == 'fr') {
<?php echo esc_attr(date_format($ts, 'j F ')) . '<span>' . esc_attr(date_format($ts, 'H:i')) . '</span>'; ?> // Line A
<?php } ?>
Code at Line A displays the following (in which month name is in English):
20 November 03:56
Problem Statement:
I am wondering what changes I should make in the PHP code above so that it displays month name in French.
date_i18n
.