change month name to french

Eva Dias picture Eva Dias · Sep 5, 2011 · Viewed 52.6k times · Source

I have this code:

<?php 
  echo "'".$sgps_newsletter->getEmail()."' demande en ".date('d.M.Y', strtotime($sgps_newsletter->getCreatedAt())) 
?> 

but the month name is appering in english. What can I do to show it in french? I've change the settings.yml default culture to french, but nothing happens.

Answer

Stefan H Singer picture Stefan H Singer · Sep 5, 2011

From http://php.net/manual/en/function.date.php:

To format dates in other languages, you should use the setlocale() and strftime() functions instead of date().