I am using Apache and php 7 on an Ubuntu System. After installing the german locales and running locale -a
to check the installed locales, I get C, C.UTF-8, d
The date()
function doesn't listen to the locales - this will be returning values in English only.
From the date()
documentation,
To format dates in other languages, you should use the setlocale() and strftime() functions instead of date().
You need to use strftime()
instead.
setlocale(LC_ALL,'de_DE');
echo strftime("%B", strtotime("2018-10-10"));