Re: Current date notation
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