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

Re: Current date notation


  • Subject: Re: Current date notation
  • From: John W Baxter <email@hidden>
  • Date: Thu, 10 May 2001 18:05:12 -0700

At 20:22 +0200 5/10/2001, Jacco Rens wrote:
>I'm looking for the syntax on current date notation. I want to have the
>output of "Current Date" as this:
>
>DD-MM-YYYY

It depends upon the intended use of your script. If it is something for
yourself, or for controlled distribution where a Scripting Addition is not
a hardship, then I'd suggest the "Date Format OSAX" which provides
format date aDate with format aFormatString
where the format string looks a lot like the ones for a semi-standard C
function whose name escapes me at the moment.

For your purposes, the format string would be "%m-%d-%Y":
format date (current date) with format "%m-%d-%Y"
-->05-10-2001

format date (current date - 1 * days) with format "%m-%d-%Y"
-->05-09-2001
just to show that you get a leading zero on single-digit days.


Try a Google search.

If Scripting Additions are a hassle for the intended use of the script, use
one of the good answers which has appeared (and will continue to appear for
a while).

--John

--
John Baxter email@hidden Port Ludlow, WA, USA


References: 
 >Current date notation (From: Jacco Rens <email@hidden>)

  • Prev by Date: Re: Network Assistant not scriptable??
  • Next by Date: Re: Rogue list?
  • Previous by thread: Re: Current date notation
  • Next by thread: Re: Current date notation
  • Index(es):
    • Date
    • Thread