Page 1 of 1

Calendar events times - server in a different timezone

Posted: Thu Aug 23, 2007 11:33 am
by loosefast
Hi all,

Is there a simple way to add a 6 hour timezone offset for Calendar events?

I have a site that is in a different timezone than the server it is hosted on.

This causes events to disappear  from the upcoming events list too soon!

Thanks,
Tom

Re: Calendar events times - server in a different timezone

Posted: Thu Aug 23, 2007 8:56 pm
by Nullig
Have you tried changing this part of the config.php file?

#Locale to use for various default date handling functions, etc.  Leaving
#this blank will use the server's default.  This might not be good if the
#site is hosted in a different country than it's intended audience.
$config['locale'] = '';

Nullig

Re: Calendar events times - server in a different timezone

Posted: Thu Aug 23, 2007 9:07 pm
by Nullig
Alternately, you could fix it by adding the following line to your .htaccess file:

SetEnv TZ location

Where location is selected from a list here - http://www.php.net/manual/en/timezones.php

Nullig

Re: Calendar events times - server in a different timezone

Posted: Fri Aug 24, 2007 9:35 pm
by loosefast
Nullig

I edited the .htaccess file per your suggestion. Will let you know how well it goes..

Thanks
Tom

Re: Calendar events times - server in a different timezone

Posted: Sat Aug 25, 2007 1:15 am
by Nullig
If that doesn't work, you can try adding the following line near the top of your config.php file:

putenv('TZ=location');

- location is from the table mentioned previously.

Nullig

Re: Calendar events times - server in a different timezone

Posted: Wed Jul 23, 2008 1:01 pm
by lainyrache
Anyone looking for an answer to this... this worked a treat!

To change the time zone to GMT, I put this code in config.php

putenv('TZ=Europe/London');

Thanks!

Re: Calendar events times - server in a different timezone

Posted: Fri Nov 21, 2008 3:39 am
by lucid
That works a treat thanks!

I used the following for australia:
putenv('TZ=Australia/Melbourne');


I guess that TZ = Time Zone ... you know that makes sense now but if you are just looking at putenv it might not be that obvious.