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

Time zone conversion.


Reply

2 Posts   2153 Views

Avatar
MrElf

4 August 2008 at 1:52pm Community Member, 9 Posts

Hi guys,

I am hosted in the US but writing an app that will have global users. One feature is an event calendar with event times. What I am looking for is a way to get the users own timezone from their clock and then do a date/time conversion so that they see the event date/time in their own timezone.

Not being a php/web app guru, what is an elegant way to do this.

Thanks in advance.

Avatar
Willr

4 August 2008 at 11:21pm Forum Moderator, 5511 Posts

Ive never done time zone support... but a good old google search never fails. I don't think theres anything built into SilverStripe (I could be wrong. Ive just never used it)

http://www.expertsrt.com/tutorials/Matt/PHPTimeZone.html
http://www.swish-db.com/tutorials/view.php/tid/380

Also on the PHP.net site there is

http://php.net/manual/en/function.date-timezone-get.php
http://php.net/manual/en/function.date.php

For reference.