• 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: Numbers dates and AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Numbers dates and AppleScript (From: Deivy Petrescu <email@hidden>)
 >Re: Numbers dates and AppleScript (From: Shane Stanley <email@hidden>)
 >Re: Numbers dates and AppleScript (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: Re: Numbers dates and AppleScript
  • Next by Date: Re: Numbers dates and AppleScript
  • Previous by thread: Re: Numbers dates and AppleScript
  • Next by thread: Re: [rant] "Never mind the quality, feel the width!"
  • Index(es):
    • Date
    • Thread