At 04:58p -0700 05/21/2003, Walter Ian Kaye didst inscribe upon an
electronic papyrus:
>MMDDYYYY_to_Date("05212003")
>
>on MMDDYYYY_to_Date(dstr)
> local dstr, myDate
> set myDate to (current date)
> set year of myDate to text 5 thru 8 of dstr
> set month of myDate to item (text 1 thru 2 of dstr) of ¬
> {January, February, March, April, May, June, ¬
> July, August, September, October, November, December}
> set day of myDate to text 3 thru 4 of dstr
> set time of myDate to 0
> myDate
>end MMDDYYYY_to_Date
Oops, had to add one line (day of the month must be temporarily set < 29).
on MMDDYYYY_to_Date(dstr)
local dstr, myDate
set myDate to (current date)
set day of myDate to 1
set year of myDate to text 5 thru 8 of dstr
set month of myDate to item (text 1 thru 2 of dstr) of ¬
{January, February, March, April, May, June, ¬
July, August, September, October, November, December}
set day of myDate to text 3 thru 4 of dstr
set time of myDate to 0
myDate
end MMDDYYYY_to_Date
-boo
fun with date objects! struct your stuff, dudes ;)
|