Re: Getting time Stamp from Applescript
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