• 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 offset for future dates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Time offset for future dates


  • Subject: Re: Time offset for future dates
  • From: Shane Stanley <email@hidden>
  • Date: Tue, 19 Dec 2017 09:45:42 +1100

On 19 Dec 2017, at 1:57 am, Takaaki Naganoya <email@hidden> wrote:
>
> on retISO8601DateTimeString(targDate, timeZoneName)
>       set theNSDateFormatter to current application's NSDateFormatter's
> alloc()'s init()
>       theNSDateFormatter's setDateFormat:"yyyy-MM-dd'T'HH:mm:ssZZZ"
>       theNSDateFormatter's setTimeZone:(current application's NSTimeZone's
> alloc()'s initWithName:timeZoneName)
>       return (theNSDateFormatter's stringFromDate:targDate) as text
> end retISO8601DateTimeString


For general use, I would add:

        theNSDateFormatter's setLocale:(current application's NSLocale's
localeWithLocaleIdentifier:"en_US_POSIX")

Otherwise the HH hour format can be overridden by local conventions.


--
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

  • Follow-Ups:
    • Re: Time offset for future dates
      • From: Takaaki Naganoya <email@hidden>
References: 
 >Time offset for future dates (From: Jörgen Stahle <email@hidden>)
 >Re: Time offset for future dates (From: Takaaki Naganoya <email@hidden>)

  • Prev by Date: Re: Time offset for future dates
  • Next by Date: Re: Time offset for future dates
  • Previous by thread: Re: Time offset for future dates
  • Next by thread: Re: Time offset for future dates
  • Index(es):
    • Date
    • Thread