Re: TIME TO GMT and Summer time
Re: TIME TO GMT and Summer time
- Subject: Re: TIME TO GMT and Summer time
- From: Ron Hunsinger <email@hidden>
- Date: Sun, 10 Jul 2011 17:22:24 -0700
On Jul 10, 2011, at 6:41 AM, Michelle Steiner wrote:
> On Jul 9, 2011, at 9:24 AM, KOENIG Yvan wrote:
>> Is there a way to get the correct value to subtract ?
> I asked the Applescript newsgroup how to determine whether the computer was on daylight savings time, and Patrick Stadelmann came through; here is his reply:
>
> do shell script "date +\"%Z\""
>
> and then see if it is part of a "DST" code. You'll have to generate the
> list yourself, e.g. from :
>
> http://en.wikipedia.org/wiki/List_of_time_zone_abbreviations
No need to build or examine the timezone name. Just get the timezone numerically, then translate from base 60 to decimal:
set tz to do shell script "date +%z"
set tz to (tz - 40 * (text 1 thru -3 of tz)) * 60
-Ron Hunsinger
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden