How do I set the 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.
Locked
EsquireX

How do I set the timezone?

Post by EsquireX »

Hello all,

I have done a search here on "locale" and but couldn't make heads not tails of it. I can't find how to set the timezone to PST.

I saw 3 different ways to change it but I'm confused on the syntax and where to put it.
  • $config['locale'] = 'en_US';
  • setlocale()
  • date_default_timezone_set()
I tried a few things but kept getting error messages so I thought I'd ask here.
gingercat
Forum Members
Forum Members
Posts: 53
Joined: Mon Aug 04, 2008 2:24 am

Re: How do I set the timezone?

Post by gingercat »

I know this is a really old post BUT did anyone find a way to over ride the time zone?

My server is based in Texas and my clients are all in New Zealand. I need a way to globally add 18 hours (I think) to any time or date settings in CMSMS.
JeremyBASS

Re: How do I set the timezone?

Post by JeremyBASS »

This is quite easy actually.

Open your .htaccess file and add the following line:
SetEnv TZ location

where location is the specific timezone you want to define.

A list of Supported Timezones can be found here:
http://www.php.net/manual/en/timezones.php


hope this helps

cheers
jeremyBass
gingercat
Forum Members
Forum Members
Posts: 53
Joined: Mon Aug 04, 2008 2:24 am

Re: How do I set the timezone?

Post by gingercat »

thanks - I thought I knew about .htaccess files but that one had slipped past me.

If I'd known it was that easy .....
JeremyBASS

Re: How do I set the timezone?

Post by JeremyBASS »

No prob... if you want more... here is a good link.. I write on many different parts...

http://www.corbensproducts.com

and I will be writing more to...

Glad I could help...

cheers
jeremyBass
Locked

Return to “CMSMS Core”