Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Strftime with German Date

Tags:

php

strftime

im trying to print the date in german with strftime. I already tried

date_default_timezone_set('Europe/Berlin');
setlocale(LC_ALL, "de_DE", "de_DE@euro", "deu", "deu_deu", "german");
$time = strftime("%B", 1323956220);
echo $time;  //I want to see "Dezember", but I see "December" instead

but it didnt work. Am I missing something?

Edit: sorry I missed the strftime funciton :P

like image 791
Enrique Moreno Tent Avatar asked Dec 28 '22 09:12

Enrique Moreno Tent


1 Answers

My guess: the locale is actually called de_DE.utf8 on your machine (it is on mine). Does this work for you?

setlocale(LC_ALL, "de_DE.utf8"); // or LC_TIME
echo strftime('%B', 1323956220);

BTW: on Linux you can use locale -a to see what's available.

like image 185
middus Avatar answered Jan 12 '23 19:01

middus