formater date FR


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. if (setlocale(LC_TIME, 'fr_FR') == '') {
  2. setlocale(LC_TIME, 'FRA'); //correction problème pour windows
  3. $format_jour = '%#d';
  4. } else {
  5. $format_jour = '%e';
  6. }
  7.  
  8. echo strftime("%A $format_jour %B %Y", strtotime('2008-04-18'));
  9. // affiche : vendredi 18 avril 2008
  10. echo strftime("%a $format_jour %b %Y", strtotime('2008-04-18'));
  11. // affiche : ven. 18 avr. 2008

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.