Re: Numbers dates and AppleScript
Re: Numbers dates and AppleScript
- Subject: Re: Numbers dates and AppleScript
- From: Shane Stanley <email@hidden>
- Date: Sat, 21 Apr 2018 11:49:49 +1000
On 21 Apr 2018, at 11:05 am, Deivy Petrescu <email@hidden> wrote:
>
> Actually I use value, but because of your question I decided to run the
> following script and the result is very telling….
It also tells you that there's a daylight savings issue, and a problem with the
resulting AppleScript dates. I suspect you can get around the issue by getting
the values as dates (once you've set the formats correctly) and then converting
them with a handler like this:
on modifyDate(theDate)
script theScript
property parent : a reference to current application
use framework "Foundation"
on modifyDate(theDate)
set theTimeZone to current application's NSTimeZone's
defaultTimeZone()
set dateOffset to theTimeZone's
secondsFromGMTForDate:theDate
set nowOffset to theTimeZone's secondsFromGMT()
set theDate to theDate - dateOffset + nowOffset
return theDate
end modifyDate
end script
return theScript's modifyDate(theDate)
end modifyDate
After that you can produce strings as you need.
But I'm only guessing; this date business is painful to think about.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>, <latenightsw.com>
_______________________________________________
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