Date month get german locale
Hey, i want to print the month name.
How i can print the german month name?
I tried to set the locale like:
@php
setlocale(LC_TIME, 'de_DE', 'deu_deu');
@endphp
For weekdays its works, but not for months.
Is there a solution for?
Thanks
@supptech Try this:
setlocale(LC_TIME, 'de_DE.UTF-8'); // Set locale to German
echo strftime("%B", time()); // Prints the current month in German
This works, but is it possible to print the last month?
Before i did with:
'''date("F",strtotime("-1 month"))'''
@supptech I think you can try this:
setlocale(LC_TIME, 'de_DE.UTF-8');
echo strftime("%B", strtotime("-1 month"));
Please or to participate in this conversation.