Daylight Savings Time
Jim Ault
JimAultWins at yahoo.com
Tue Oct 28 16:49:44 EDT 2008
Just a thought.. could you program something to access a time service based
on zip code in the US, or city, state, country to register the correct local
time. My cell phone will update at the time of switchover, so perhaps that
could be the better technique, although it does require an internet
connection.
Jim Ault
Las Vegas
On 10/28/08 10:51 AM, "Ken Ray" <kray at sonsothunder.com> wrote:
>
>> This works well for me:
>>
>> function DaylightSavingsTimeIsActive
>> local tCurDate,tRefDate
>> -----
>> put the short date into tCurDate
>> convert tCurDate from short date to dateItems
>> put tCurDate into tRefDate
>> repeat with i = 2 to 3
>> put 1 into item i of tRefDate
>> -- January first
>> end repeat
>> convert tRefDate from dateItems to dateItems
>> -- updates last item of dateItems value
>> convert tCurDate from dateItems to seconds
>> convert tRefDate from dateItems to seconds
>> return (tRefDate - tCurDate) mod 86400 = 0
>> end DaylightSavingsTimeIsActive
>
> The only trouble with this is that there are some places in the world where
> DST is not an hour, but is sometimes 30 minutes or 90 minutes; also, there
> are parts of the US, for example, that do not observe DST even though the
> rest of the US does - Arizona is an example, so I don't know how this would
> run there.
>
> Unfortunately there isn't a comprehensive way to know if DST is in effect
> without knowing *where* the person is who's executing the code (AFAICT).
>
> And of course it gets worse when you're asking for DST in effect for a
> specific date and place...
>
> Ken Ray
> Sons of Thunder Software, Inc.
> Email: kray at sonsothunder.com
> Web Site: http://www.sonsothunder.com/
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list