Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Timezone


Reply


8 Posts   16621 Views

Avatar
Shane Garelja

Community Member, 18 Posts

19 March 2008 at 3:13pm

Firstly, fantastic framework! This is exactly what I have been looking for and why I have spent the last few years intermittently writing my own CMS as all the others out there are far to restrictive. My one sits on top of a framework that uses XML to define data models for content, you guys have used a similar approach to what I have done except it's all done with PHP and is obviously ~considerably~ more advanced :P

After completing my first SS implementation last weekend (http://www.kiwi-ise.co.nz/) I am looking forward to learning much more about this framework.

I do have a simple question to start with and I have hunted everywhere... is it possible to change the default timezone for SS if your site is hosted in a different country? Is there a reference doc with all the config settings that would cover this?

Thanks again! And sorry Sig/Tim that it's taken you about 2 years to convince us [Doubleclique] to try this :)

Avatar
simon_w

Forum Moderator, 474 Posts

19 March 2008 at 4:31pm

In mysite/_config.php:

date_default_timezone_set('zone');

A list of available time zones is available [url=http://nz.php.net/manual/en/timezones.php]here[/url]

Avatar
Shane Garelja

Community Member, 18 Posts

19 March 2008 at 4:33pm

Thanks Simon! Could you tell me where this is documented?

Avatar
simon_w

Forum Moderator, 474 Posts

19 March 2008 at 4:35pm

PHP's website: [url]http://php.net/date_default_timezone_set[/url]

Avatar
Shane Garelja

Community Member, 18 Posts

19 March 2008 at 4:51pm

Edited: 19/03/2008 4:51pm

HAHAHA - no, I mean the date_default_timezone_set() method - I could not find this anywhere in docs or forum... is this just something you "know"? :)

Avatar
simon_w

Forum Moderator, 474 Posts

19 March 2008 at 4:54pm

Yeah. It's not actually part of SilverStripe, but it changes the default timezone that PHP uses for everything involving dates, including all Date* classes in SilverStripe.

Avatar
Shane Garelja

Community Member, 18 Posts

19 March 2008 at 10:03pm

Of course! Thanks :)

For some strange reason it does not seem to have done what I expected... I thought this would change all the times for comments, blogs, forum posts etc??

Avatar
Louie

Community Member, 9 Posts

6 June 2008 at 2:52am

hello! im having the same problem... what if my site doesn't have a mysite/_config.php.. where else can I put date_default_timezone_set('......'); into?