• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: TIME TO GMT and Summer time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: TIME TO GMT and Summer time
      • From: Ron Hunsinger <email@hidden>
References: 
 >TIME TO GMT and Summer time (From: KOENIG Yvan <email@hidden>)
 >Re: TIME TO GMT and Summer time (From: Michelle Steiner <email@hidden>)

  • Prev by Date: Re: Moving Items
  • Next by Date: Re: TIME TO GMT and Summer time
  • Previous by thread: Re: TIME TO GMT and Summer time
  • Next by thread: Re: TIME TO GMT and Summer time
  • Index(es):
    • Date
    • Thread