Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

youssefboudaya's avatar

How to change the language of strftime function in php

I have a Laravel project that have a blog module in it.In my localhost the date of creation of the article is displayed in french which is correct but when i publish my project online (shared host) the dates are still displayed in English. This is my code:

<?php 
  setlocale(LC_TIME, 'fr_FR');
  echo strftime("%d %B %G", strtotime($lastNews->created_at));
?>
0 likes
4 replies
vektorstudio's avatar

Check your server for Locale extensions, see if they are installed there, u could start locally, and replicate in the server

youssefboudaya's avatar

in my localhost it works fine.How can i check myserver for Locale extensions ?

youssefboudaya's avatar

how can i do that ? i'm not much of an expert concerning servers

Please or to participate in this conversation.