Search code examples
phpsymfony-1.4

change month name to french


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.


Solution

  • 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().