Page 1 of 1

Time Zones

Posted: Thu Jun 24, 2010 2:15 am
by phaworth
I need to display times in my app based on the time zone the user is in and the time zone of the time in an entry in my database. I will know which timezone each db entry is in because it also includes full address data. So I have the data I need and could could probably write the code but just wondering if anyone has already done it.
Thanks,
Pete

Re: Time Zones

Posted: Thu Jun 24, 2010 8:20 am
by bn
Hi Pete,

look at Sarah's site:
http://www.troz.net/rev/index.irev?category=All#stacks
DateTime and Calendar might give you some ideas.
Sarah is THE expert on time/date in Rev.
regards
Bernd

Re: Time Zones

Posted: Thu Jun 24, 2010 8:40 am
by Klaus
bn wrote:...
Sarah is THE expert on time/date in Rev.
...
Yeah, call her CHRONOS! :D

Re: Time Zones

Posted: Thu Jun 24, 2010 9:25 am
by bn
Klaus,
Yeah, call her CHRONOS!
she wouldn't eat her children, would she? :)

regards
Bernd

Re: Time Zones

Posted: Thu Jun 24, 2010 10:01 am
by Klaus
Hmmm, I'm afraid every genius has its dark side(s)... :D

Sarah, we are just kidding, believe me! 8)

Re: Time Zones

Posted: Thu Jun 24, 2010 5:04 pm
by phaworth
Thanks everyone. I already use Sarah's date picker stack in my ap, should have thought of that.
Pete

Re: Time Zones

Posted: Thu Jun 24, 2010 5:24 pm
by phaworth
Just took a quick look at Sarah's date routines and there are a couple in there that will be useful (converting between timestamp and seconds) but nothing specifically to do with time zones and conversion between them.

I think what I need is a function that will take a timestamp, some sort of indication of the geographic location of that timestamp, and another indication of the geographic location I want the timestamp converted to. So something like "If it's 9:30am on June 24th, 2010 in California, what time is it in New Hampshire". I guess I would need a table of states and their respective timezones to do that and I have to deal with Daylight Savings Time issues since some states don't observe it. Plus I really should deal with worldwide locations, not just US states. Gonna be interesting!

Pete

Re: Time Zones

Posted: Thu Jun 24, 2010 11:51 pm
by FourthWorld
Using "the internet date" produces a format that includes the GMT offset, e.g.:

Thu, 24 Jun 2010 15:51:51 -0700