Daylight Saving Time

Richard Miller wow at together.net
Mon Oct 27 07:33:04 EDT 2008


Thanks, Sarah. I'm not thrilled about this solution (as you don't  
seem to be either), but perhaps it's the best there is. Anyone know  
how to get this "time zone data" from a PC?

Richard



On Oct 26, 2008, at 6:19 PM, Sarah Reichelt wrote:

> On Mon, Oct 27, 2008 at 7:59 AM, Richard Miller <wow at together.net>  
> wrote:
>> Is there a simple way to know whether DST is in effect in a  
>> particular
>> location? Would it make sense, for example, to compare "the short  
>> time" with
>> the local time as accessed through some web site? If they're not  
>> the same,
>> assume DST is in effect? If so, any ideas for a web site to access  
>> for the
>> current time?
>
> The only way I found to do this was to get the AppleScript time zone
> data and the Rev time zone data and work out the number of seconds
> difference between the two. Here is my function for getting the
> current number of seconds of daylight savings time:
>
> function DSTseconds
>     put the internet date into tNow
>     put last word of tNow into tZone
>     replace "+" with empty in tZone
>     put char -2 to -1 of tZone into tMins
>     delete char -2 to -1 of tZone
>     add tMins / 60 to tZone
>     put "tell application " & quote & "Finder" & quote & "" & cr \
>             & "return time to GMT" & cr & "end tell" into tScript
>     do tScript as AppleScript
>     put the result / 3600 into tDiff
>     put (tDiff - tZone) * 3600 into tDST
>
>     return tDST
> end DSTseconds
>
> e.g. where I am in Queensland, Australia, we have no daylight savings
> so this returns 0.
> If I set my location to Sydney which has 1 hour of daylight savings at
> this time of year, I get 3600.
>
> Of course this is a Mac only solution and it only works for the time &
> location settings of the computer where the app is running, you cannot
> feed it the name of a city and ask for the data.
>
> Cheers,
> Sarah
> _______________________________________________
> 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