• 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: Set Current date to new folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Set Current date to new folder (From: Joe Calabria <email@hidden>)

  • Prev by Date: Re: Set Current date to new folder
  • Next by Date: Re: applescript-users digest, Vol 2 #222 - 16 msgs
  • Previous by thread: Re: Set Current date to new folder
  • Next by thread: Re: Set Current date to new folder
  • Index(es):
    • Date
    • Thread