Re: Do shell script "date" vs current date
Re: Do shell script "date" vs current date
- Subject: Re: Do shell script "date" vs current date
- From: JollyRoger <email@hidden>
- Date: Mon, 11 Mar 2002 19:22:30 -0600
On 3/11/2002 10:23 AM, "John W Baxter" <email@hidden> wrote:
>
At 8:38 -0700 3/11/2002, garbanzito wrote:
>
> however even just the shell's date command has some options
>
> that might be hard to reproduce with current date.
>
>
For instance,
>
do shell script "date +%Y-%m-%d"
>
--> "2002-03-11"
It's not _that_ hard to do:
-- begin script
My FormatDate(current date)
on FormatDate(theDate)
set theDate to theDate as date
set dd to text -2 thru -1 of ("0" & theDate's day)
copy theDate to tempDate
set the month of tempDate to January
set mm to text -2 thru -1 of ,
("0" & 1 + (theDate - tempDate + 1314864) div 2629728)
set yy to text -1 thru -4 of ((year of theDate) as text)
return (yy & "-" & mm & "-" & dd as text)
end FormatDate
-- end script
JR
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.