My PHP-code
$now = new \DateTime();
echo $now->format('d. M.')
What I get
12. Dec.
(in English)
Want I want
12. Dez.
(in German)
My current solution
$formatter = new \IntlDateFormatter(
"de-DE",
\IntlDateFormatter::FULL,
\IntlDateFormatter::NONE,
"Europe/Berlin",
\IntlDateFormatter::GREGORIAN,
"dd. MMM"
);
echo $formatter->format($now);
Question
Creating alway $formatter
is a little bit heavy.
Isn't it possible to change something in php.ini
(or similar) to get always the german words when calling the "month" when using $now->format('d. M.')
?
I tried already in php.ini
this (but it didn't helped):
intl.default_locale = de