php - Display date in portuguese locales
Get the solution ↓↓↓I have two dates start and end date.I want to show the dates in portuguese locales. in config->app.php
'locale' => 'pt-br',
<p>@php echo date('F jS, Y', strtotime($eventDetails->startDate));@endphp -
@php echo date('F jS, Y', strtotime($eventDetails->endDate));@endphp</p>
i need to print the date in : De 27 a 30 de Maio de 2020
Answer
Solution:
Try this
setlocale(LC_ALL, "pt_BR");
$startdate = strftime('%e', $eventDetails->startDate);
$enddate = strftime('%e %B %G', $eventDetails->endDate);
echo "De ".$startdate." a ".$enddate;
You can find more information about formatting your the strftime function here: https://www.php.net/manual/en/function.strftime.php
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: object not found by the @paramconverter annotation.
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.