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   16550 Views

Avatar
Shane Garelja

19 March 2008 at 3:13pm Community Member, 18 Posts

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

19 March 2008 at 4:31pm Forum Moderator, 474 Posts

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

19 March 2008 at 4:33pm Community Member, 18 Posts

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

Avatar
simon_w

19 March 2008 at 4:35pm Forum Moderator, 474 Posts

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

Avatar
Shane Garelja

19 March 2008 at 4:51pm (Last edited: 19 March 2008 4:51pm), Community Member, 18 Posts

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

19 March 2008 at 4:54pm Forum Moderator, 474 Posts

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

19 March 2008 at 10:03pm Community Member, 18 Posts

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

6 June 2008 at 2:52am Community Member, 9 Posts

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?