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:14:19 -0500
On Thu, Dec 4, 2008 at 4:38 PM, Doug McNutt <email@hidden> wrote:
> Does anyone know how to get a date to look like that from AppleScript.
Applescript uses the date and time formatting from the International
system preferences pane. Change that and change the AS result.
For programmatic control, as Doug said:
> Have a look at the UNIX date command.
...but, as Doug also said, as soon as you start forking and executing
other programs, you can throw millisecond-resolution out the window.
> do shell script quoted form of (date "+%y-%m-%d %H:%M:%S")
Slight error there - should be %Y, not %y; %y is the two-digit year.
But those are such common formats for the date and time that it has
built-in support for them, so you can get the result more succinctly
with date +"%F %T".
--
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