Web Hosting Talk







View Full Version : Change timezone for client in htaccess file


CoolMike
11-22-2002, 10:28 AM
Hi

Our servers are located in a different timezone. At the moment we use the following code, to switch to the correct time zone in PHP files:

putenv("TZ=Etc/GMT-2");

Is it possible to set the timezone also in the htaccess file? With this solution, every user could have the own timezone on the server and don't need to change the scripts.

Thanks for your help.
BR
Michael

MarkIL
11-22-2002, 01:20 PM
You could use mod_env for apache and put
"PassEnv TZ=whatever" in .htaccess or the virtual host directive.

CoolMike
11-22-2002, 04:23 PM
Hi

I tested it and it doesn't work. mod_env is installed and the htaccess file looks like this:
PassEnv TZ=Etc/GMT-2
I saved the htaccess file in the same directory, where the scripts run.

Anything else which is important?

Thanks for your help lewney.

Mike

elsmore1
11-22-2002, 04:54 PM
Try SetEnv ....

SetEnv TZ Etc/GMT-2

The apache documentation is pretty helpful on this.

CoolMike
11-22-2002, 05:19 PM
Also this doesn't work... I don't get an error message, just nothing.

Mike