mercredi 31 octobre 2018

Carbon::setLocale() not working Laravel 5.4

I'want to print the current date in spanish with Carbon with this format: Miércoles 31 de octubre 2018 but I only get Wednesday 31 October 2018 . I already used

Carbon::setLocale('es');
$fecha = Carbon::now()->format('l j F Y');

and

Carbon::setLocale(LC_TIME, 'es');
$fecha = Carbon::now()->format('l j F Y');

In config/app.php I tried with

Carbon\Carbon::setLocale('es');

I also tried es_ES, es_MX, es_US, es_MX.utf8 but it keeps returning the date on english. I am working on linux and I already added the locales I need.

Does anyone know how to solve this?

Thanks!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire