Time Zones

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Time Zones

Post by phaworth » Thu Jun 24, 2010 2:15 am

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

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Time Zones

Post by bn » Thu Jun 24, 2010 8:20 am

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

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Time Zones

Post by Klaus » Thu Jun 24, 2010 8:40 am

bn wrote:...
Sarah is THE expert on time/date in Rev.
...
Yeah, call her CHRONOS! :D

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Time Zones

Post by bn » Thu Jun 24, 2010 9:25 am

Klaus,
Yeah, call her CHRONOS!
she wouldn't eat her children, would she? :)

regards
Bernd

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Time Zones

Post by Klaus » Thu Jun 24, 2010 10:01 am

Hmmm, I'm afraid every genius has its dark side(s)... :D

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

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Re: Time Zones

Post by phaworth » Thu Jun 24, 2010 5:04 pm

Thanks everyone. I already use Sarah's date picker stack in my ap, should have thought of that.
Pete

phaworth
Posts: 592
Joined: Thu Jun 11, 2009 9:51 pm

Re: Time Zones

Post by phaworth » Thu Jun 24, 2010 5:24 pm

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

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Time Zones

Post by FourthWorld » Thu Jun 24, 2010 11:51 pm

Using "the internet date" produces a format that includes the GMT offset, e.g.:

Thu, 24 Jun 2010 15:51:51 -0700
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply