Re: Time offset for future dates
Re: Time offset for future dates
- Subject: Re: Time offset for future dates
- From: Takaaki Naganoya <email@hidden>
- Date: Tue, 19 Dec 2017 13:56:15 +0900
2017/12/19 7:45、Shane Stanley <email@hidden>のメール:
> 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.
Thanks Shane.
Jörgen wrote me a thanks message directly.
--
Takaaki Naganoya
email@hidden
http://piyocast.com/as/
_______________________________________________
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