How to format dates based on locale?
问题 In a template I display the day and month of a specific date : <div class="jour"><?php echo date('d',strtotime($content->getCreatedAt())) ?></div> <div class="mois"><?php echo date('M',strtotime($content->getCreatedAt())) ?></div> This works fine, problem is the month name is in English. Where do I specify that I want the month names in another locale, French for instance ? 回答1: Symfony has a format_date helper among the Date helpers that is i18n-aware. The formats are unfortunately badly