Long month names in PHP date

I would like to announce the month in german. Shouldn’t that be possible via the setlocale? I only get the English version.

Doesn’t work

setlocale(LC_TIME, "de_DE");

Doesn’t work (in config.php)

'locale' => 'de_DE.utf-8',

Is the locale installed in your system? Check with locale -a in a terminal.

Thanks for your answer. But seems to be all ok?

de_AT
de_AT.ISO8859-1
de_AT.ISO8859-15
de_AT.UTF-8
de_CH
de_CH.ISO8859-1
de_CH.ISO8859-15
de_CH.UTF-8
de_DE
de_DE.ISO8859-1
de_DE.ISO8859-15
de_DE.UTF-8

Are you using date()? That function doesn’t have internationalization. You’ll have to use strftime().

Here’s two links to help you out.


The guys gave the right advice.
If you don’t want to use strftime () then you can make a replacement.
Like here Replacing the name of the month in the genitive case help from @texnixe
If date () is not used often on the site.
Maybe with a lookup table (array) in config. Then in your template, do some string replacement.

Thanks at all, I have used strftime() which works great. Wasn’t aware between the difference.