SetEnv TZ Trouble

SetEnv TZ Trouble

Posted by: Rich
Posted on: 2006-02-23 10:28:00

I've searched the forums and read all posts concerning timezones. The best solution I found for changing my websites timezone was to add "SetEnv TZ Europe/London" to my .htaccess file (I also tried "SetEnv TZ GMT).

I did this and php echo date("d/m/Y G:i T"); still gives me PST.

Can anyone help me solve this problem?

Any tips will be hugely appreciated,
Rich.

Re: SetEnv TZ Trouble

Posted by: psross
Posted on: 2006-02-23 12:46:00

From within your php script you can use the following to set the TZ environment variable:

putenv('TZ=Europe/London');

Once Dreamhost have upgraded to PHP 5.1 (or if you have compiled your own copy), you can use:

date_default_timezone_set('Europe/London');

Re: SetEnv TZ Trouble

Posted by: Rich
Posted on: 2006-02-24 00:21:00

Thanks for the reply.

So SetEnv doesn't work here then?

I was trying to avoid adding putenv to all my scripts, it's looking like I don't have a choice, meh.

Tags: setenvhtaccess filetimezonestimezoneappreciatedeuropeforumsgmtaddhelp