• 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: Getting time Stamp from Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting time Stamp from Applescript


  • Subject: Re: Getting time Stamp from Applescript
  • From: "Mark J. Reed" <email@hidden>
  • Date: Thu, 4 Dec 2008 17:23:51 -0500

On Thu, Dec 4, 2008 at 5:09 PM, Stan Cleveland <email@hidden> wrote:
> Note that AppleScript doesn't natively resolve beyond whole seconds, so I
> just tack on the decimal point and three zeros.

You can do that with date by just adding .000 to the format string:

date +"%F %T.000"

Unfortunately that's the best you can do without rolling your own
routine; the internal data structure used by strftime(3), which is
what the date command uses, only stores integer seconds.  Even though
there are other system calls that let you get higher-resolution
timestamps, there's no support for formatting them in the standard
library on OS X.  (The glibc strftime(), found on most Linux
distributions, adds the %N specifier, which returns nanoseconds into
the current second, and support field width modifiers; the combination
lets you get millseconds with date +%3N.)

--
Mark J. Reed <email@hidden>
 _______________________________________________
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: 
 >Getting time Stamp from Applescript (From: "Troy, Drew" <email@hidden>)
 >Re: Getting time Stamp from Applescript (From: Stan Cleveland <email@hidden>)

  • Prev by Date: Re: Getting time Stamp from Applescript
  • Next by Date: Re: Getting time Stamp from Applescript
  • Previous by thread: Re: Getting time Stamp from Applescript
  • Next by thread: Re: Getting time Stamp from Applescript
  • Index(es):
    • Date
    • Thread