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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do you have the
delocale available; what doessetlocalereturn for you? See: return values for setlocale().Also, check the list of available locales (e.g.
locale -aor whatever is suitable for your OS) to see ifdeis among them. Likely alternatives includede_DEorde_DE.utf8to name a few.In Debian, to generate a new locale, run this command:
and pick the ones you want.