Calendar events times - server in a different timezone

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
loosefast
Forum Members
Forum Members
Posts: 36
Joined: Sun Jan 29, 2006 7:06 pm

Calendar events times - server in a different timezone

Post 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
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Calendar events times - server in a different timezone

Post 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
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Calendar events times - server in a different timezone

Post 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
User avatar
loosefast
Forum Members
Forum Members
Posts: 36
Joined: Sun Jan 29, 2006 7:06 pm

Re: Calendar events times - server in a different timezone

Post by loosefast »

Nullig

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

Thanks
Tom
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm

Re: Calendar events times - server in a different timezone

Post 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
lainyrache
Forum Members
Forum Members
Posts: 106
Joined: Thu Oct 05, 2006 11:27 am

Re: Calendar events times - server in a different timezone

Post 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!
lucid
Forum Members
Forum Members
Posts: 29
Joined: Mon Nov 12, 2007 2:48 pm

Re: Calendar events times - server in a different timezone

Post 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.
Post Reply

Return to “CMSMS Core”