Re: Set Current date to new folder
Re: Set Current date to new folder
- Subject: Re: Set Current date to new folder
- From: "Christopher C. Stone" <email@hidden>
- Date: Mon, 15 Jan 2001 05:15:40 -0600
At 01/14/2001 23:34 -0500, Joe Calabria wrought:
>
I want to create a new folder and name it the current date in the following
>
format: 1/15/01
>
>
I need to fill in the ???????:
___________________________________________________________________________
Hello Joe,
I believe this is the fastest of the vanilla methods. I generally use an osax myself, but this little handler is great.
---------------------------------------------------------------------------
on shortDate() -- adpated from Emmanuel Levy
set dlm to "/"
set fullMonth to 2629728 -- 730.48 * 60 * 60
set halfMonth to fullMonth div 2 -- 1314864
set currDate to (current date)
copy currDate to janDate
set the month of janDate to January
set monthNum to (1 + (currDate - janDate + halfMonth) div fullMonth)
set mo to text -2 thru -1 of (("0" & monthNum) as string)
set da to text -2 thru -1 of ("0" & (day of currDate as string))
set yr to text -2 thru -1 of ("" & year of currDate)
return "" & mo & dlm & da & dlm & yr
end shortDate
shortDate()
---------------------------------------------------------------------------
Best Regards,
Christopher Stone
______________________________
StoneWorks Computer Consulting
email@hidden