...

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



crmpicco
11-04-2007, 05:13 PM
Hi,

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!



date_default_timezone_set('Europe/Berlin');
// 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,
Picco

gunman
11-05-2007, 02: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'));



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum