Re: TIME TO GMT and Summer time
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