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

eLekun's avatar

Date format in english

I have the following line that returns the following according to the date:

DateTime::createFromFormat('Y-m-d', $archivo->fecha)->format('M-Y')

Dec-2022

How could I translate the month into Spanish? Thanks

0 likes
2 replies
eLekun's avatar

Thanks, I'll stay as follows:

\Carbon\Carbon::parse($file->date)->translated format('F Y ');

1 like

Please or to participate in this conversation.