• 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: Date trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date trouble


  • Subject: Re: Date trouble
  • From: "Mark J. Reed" <email@hidden>
  • Date: Fri, 20 Oct 2006 09:41:16 -0400

On 10/20/06, Rob Stott <email@hidden> wrote:
If you're not averse to using a bit of shell scripting then this should do
the job for you...

set theDate to do shell script "date \"+%Y-%m-%d %H:%M:%S\""

Two minor suggestions:

1. I prefer to avoid backslashitis by not using double-quotes inside
"do shell script" if i can help it.  Since you're not doing any
shell-level interpolation inside the format string, you can use single
quotes here.

2. Also, both %Y-%m-%d and %H:%M:%S have single-specifier shortcuts.

set theDate to (do shell script "date +'%F %T' ")


Hope that helps

Rob




---

Rob Stott
Production Workflow Developer

Watt Gilchrist Ltd
Albion Mills, Albion Road
Bradford, BD10 9TQ

http://www.gilchrist.co.uk
Internal extension: 467




_______________________________________________ Do not post admin requests to the list. They will be ignored. AppleScript-Users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden




--
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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Date trouble
      • From: Rob Stott <email@hidden>
References: 
 >Date trouble (From: "W. Thomas Leroux" <email@hidden>)
 >Re: Date trouble (From: Rob Stott <email@hidden>)

  • Prev by Date: RE: Choose File
  • Next by Date: Claudio Braxmaier ist bis 25.10.2006 nicht da
  • Previous by thread: Re: Date trouble
  • Next by thread: Re: Date trouble
  • Index(es):
    • Date
    • Thread