• 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: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

References: 
 >Getting time Stamp from Applescript (From: "Troy, Drew" <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