• 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: KOENIG Yvan <email@hidden>
  • Date: Sun, 10 Jul 2011 16:40:46 +0200


Le 10 juil. 2011 à 15:41, Michelle Steiner a écrit :

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


Thanks a lot Michelle.

It's exactly what I needed.

--{code}
tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
tell cell "B16"
set maybe to value
set maybef to format
end tell


if class of maybe is date then


set maybe2 to maybe - (my time_to_GMT_without_DST())
set maybe3 to date string of maybe
end if
tell cell "D14"
set value to (maybe as text)
set format to maybef
end tell
if class of maybe is date then
tell cell "D15"
set value to (maybe2 as text)
set format to maybef
end tell
tell cell "D16"
set value to (maybe3 as text)
set format to maybef
end tell
end if
end tell

on time_to_GMT_without_DST()
if last word of (do shell script "zdump `date +\"%Z\"`") = "UTC" then
return (time to GMT) - 3600
else
return time to GMT
end if
end time_to_GMT_without_DST
--{code}

In D15, I get the correct result, the one in maybe2.

So, with a bit of cleaning the code able to transfer a date become :

--{code}
tell application "Numbers" to tell document 1 to tell sheet 1 to tell table 1
tell cell "B16"
set {maybe, maybef} to {value, format}
end tell


if class of maybe is date then
set maybe to maybe - (my time_to_GMT_without_DST())
end if


tell cell "D14"
set {value, format} to {maybe as text, maybef}
end tell
end tell

on time_to_GMT_without_DST()
if last word of (do shell script "zdump `date +\"%Z\"`") = "UTC" then
return (time to GMT) - 3600
else
return time to GMT
end if
end time_to_GMT_without_DST
--{code}

Yvan KOENIG (VALLAURIS, France) dimanche 10 juillet 2011 16:40:22


 _______________________________________________
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

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: TIME TO GMT and Summer time
  • Next by Date: key pressed event
  • Previous by thread: Re: TIME TO GMT and Summer time
  • Next by thread: Re: TIME TO GMT and Summer time
  • Index(es):
    • Date
    • Thread