I have the following snippet of code:
setlocale(LC_ALL, "de");
print(strftime("%A %e %B %Y", time()));
and it's printing
Tuesday 4 May 2010
instead of
Dienstag 4. Mai 2010
Any ideas why? How to fix?
Do you have the de
locale available; what does setlocale
return for you? See: return values for setlocale().
Also, check the list of available locales (e.g. locale -a
or whatever is suitable for your OS) to see if de
is among them. Likely alternatives include de_DE
or de_DE.utf8
to name a few.
In Debian, to generate a new locale, run this command:
dpkg-reconfigure locales
and pick the ones you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With