Sunday, November 27, 2022

#1 2003-04-30 01:17:32 pm

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

Another Date Thingy

Snagged this from fellow scripter, Kevin Talbert.
A primo date script snippet I re-use all the time to give me lots of flexible date display options

OS version: Any


set todaysDate to (current date)
set {m, d, y} to {month, day, year} of todaysDate
set monthList to {January, February, March, April, May, June, ¬
   July, August, September, October, November, December}
repeat with i from 1 to 12
   if m = (item i of monthList) then
       set monthString to text -2 thru -1 of ("0" & i)
       exit repeat
   end if
end repeat
set dayString to text -2 thru -1 of ("0" & d)
set yearString to text -2 thru -1 of (y as string)
set myDate to monthString & "/" & dayString & "/" & yearString

One mans trash is another mans treasure



Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)