Re: Date of next Thursday
Re: Date of next Thursday
- Subject: Re: Date of next Thursday
- From: Allen Watson <email@hidden>
- Date: Wed, 15 Nov 2000 22:57:10 -0800
On or near 11/15/00 2:29 PM, Yosemite at email@hidden observed:
>
-- FYI: without using run script
>
>
set today to characters 1 thru 3 of (weekday of (current date) as string) as
>
string
>
set theWeekdays to "SunMonTueWedThuFriSat"
>
set today to (offset of today in theWeekdays) div 3 + 1
>
set ThursOffset to ((7 - today) + 5) mod 7
>
set nextThursday to date string of ((current date) + (ThursOffset * days))
>
nextThursday
>
Very good! Simple is better. And we could make that first line just a little
clearer and shorter like this:
set today to text 1 thru 3 of (weekday of (current date) as string)
>
>
> set today to weekday of (get current date) as string
>
> set today to (run script "set theWeekdays to {Sunday:1, Monday:2, Tuesday:3,
>
> Wednesday:4, Thursday:5, Friday:6, Saturday:7}" & return & "set today to " &
>
> today & " of theWeekdays")
>
> set ThursOffset to ((7 - today) + 5) mod 7
>
> set nextThursday to date string of ((current date) + (ThursOffset * days))
>
> nextThursday
>
>
>
> I used the "run script" because it was the only way I could think of to
>
> translate the weekday name into a field name for the lookup in the record.
>
>
--
Peace be with you!
Allen <email@hidden> XNS Name: =Allen Watson
My web page: <
http://home.earthlink.net/~allenwatson/>