• 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: UTC time with milliseconds
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: UTC time with milliseconds


  • Subject: Re: UTC time with milliseconds
  • From: Shane Stanley <email@hidden>
  • Date: Tue, 24 Feb 2015 10:00:25 +1100

On 24 Feb 2015, at 9:30 am, Shane Stanley <email@hidden> wrote:

You could always use ASObjC:

But let's get the script right. I forgot to set the time zone, and coerce the result to text:

use framework "Foundation"

set theNSDateFormatter to current application's NSDateFormatter's alloc()'s init()
theNSDateFormatter's setDateFormat:"yyyy-MM-dd'T'HH:mm:ss.SSS"
theNSDateFormatter's setTimeZone:(current application's NSTimeZone's timeZoneForSecondsFromGMT:0)
return (theNSDateFormatter's stringFromDate:(current application's NSDate's |date|())) as text

-- 
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>

 _______________________________________________
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: 
 >Re: UTC time with milliseconds (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: UTC time with milliseconds
  • Next by Date: clear set property on each run
  • Previous by thread: Re: UTC time with milliseconds
  • Next by thread: Re: UTC time with milliseconds
  • Index(es):
    • Date
    • Thread