Page 1 of 1

Setting timezone globally

Posted: Tue Oct 06, 2009 10:57 pm
by edawson003
I would like to set my timezone globally for a certain directory. I read somewhere that the syntax to add to my php.ini to affect timezone globally is
;date.timezone =Asia/Jakarta
. I tried it, but it didn't work. Am I not using the right syntax.

In the meantime, I am able to affect timezon on a page by page basis by applying:

Code: Select all

<?
ini_set('date.timezone', 'America/Los_Angeles');
?>
I have a form where I ask visitors to identify their timezone. Is there a way to customize date for affected users based on the timezone they specified?

Re: Setting timezone globally

Posted: Wed Oct 07, 2009 1:47 am
by John Cartwright
You can modify the PHP timezones settings in php with SetEnv.

I.e. (.htaccess)
SetEnv TZ America/Montreal
Note however, this does NOT affected mysql datetime settings.