View Full Version : set time zone and print day and date in PHP 4

11-04-2007, 06:13 PM

Can anyone tell me how to set the local time zone and write it out in this format in PHP 4 (my server is using PHP 4.4.4).

I have PHP 5 on my local machine and was originally using the following code, which worked fine!

// Set the gloabal LC_TIME constant to german for the purpose of the date
setlocale(LC_ALL, "de_DE", "de_DE@euro", "deu", "deu_deu", "german");

However, it is not supported in PHP 4.

I've looked in "putenv", but it does not change the day value, i.e. from Sunday to Sonntag.

English Version: Sunday, 04. November 2007
German Version: Sonntag, 04. November 2007

Any help is much appreiated,

11-05-2007, 03:47 PM
Try this code. It is working with php 4.3.11

setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
echo strftime("%A %e %B %Y", date('U'));