Answer the question
In order to leave comments, you need to log in
How to do localize date in laravel?
Hello
Can you please tell me how to localize the date in the laravel script?
I have never used it, so I don’t understand.
I found several modules, but it’s not clear where and what to install.
Maybe someone knows in detail
Answer the question
In order to leave comments, you need to log in
Try this:
French locale example:
$date = Carbon::now()->locale('fr_FR');
echo $date->locale(); // fr_FR
echo "\n";
echo $date->diffForHumans(); // il y a 1 seconde
echo "\n";
echo $date->monthName; // février
echo "\n";
echo $date->isoFormat('LLLL'); // lundi 25 février 2019 22:28
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question