• 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: Michelle Steiner <email@hidden>
  • Date: Sun, 10 Jul 2011 06:41:51 -0700

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

There's another way that works for CET / CEST (Europe)  but it doesn't
seem to be documented behavior, so it might not work in every case.

The shell command "zdump" followed by the current timezone code returns :

  zdump CET
  CET  [...] CET

when DST is off, and

  zdump CEST
  CEST  [...] UTC

when DST is on. So the DST status can be obtained with :

  last word of (do shell script "zdump `date +\"%Z\"`") = "UTC"

--
I am Dyslexic of Borg. Fusistance is retile. Your ass will be laminated.

 _______________________________________________
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>
    • Re: TIME TO GMT and Summer time
      • From: KOENIG Yvan <email@hidden>
References: 
 >TIME TO GMT and Summer time (From: KOENIG Yvan <email@hidden>)

  • Prev by Date: Re: Executing AppleScripts in multithreaded Cocoa App
  • 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