tags:

views:

38

answers:

3

Hi all I need to format date exactly like this Dienstag 28. September 2010, 15:00 Uhr (German words), what is the best way? Thanks.

I guess I have to use date function but how to compose format

+3  A: 

date() won´t be able to get you a German text, you will have to use strftime()

Example:

setlocale(LC_TIME, "de_DE");
strftime("%A %e. %B %Y, %H:%M Uhr", $your_date);
jeroen
Thanks, even though strftime() was enough ;)
Centurion
You're welcome! Perhaps your server already has its locale set to German...
jeroen
+1  A: 

setlocale and strftime

setlocale(LC_TIME, 'de_DE@euro', 'de_DE', 'de', 'ge');
echo strftime("%A %d %B %Y, %H:%M");
maggie
+1  A: 

You can set your language in PHP with setlocale() and then use strftime() with the corresponding format. That will allow you to get german output.

dantz