Re: Date of next Thursday
Re: Date of next Thursday
- Subject: Re: Date of next Thursday
- From: Nigel Garvey <email@hidden>
- Date: Thu, 16 Nov 2000 12:49:40 +0000
Nigel Garvey wrote on Thu, 16 Nov 2000 02:16:04 +0000:
[Quoting Michelle]:
>
>On 11/15/00 3:17 PM, Nigel Garvey <email@hidden> wrote
>
>
>
>>set dref to date "Thursday, 6 January 2000 00:00:00"
>
>>set nextThursday to dref + (round (((current date) - dref) / weeks)
>
>>rounding up) * weeks
>
In fact the formula could be made slightly more
>
efficient,
>
set dref to date "Thursday, 6 January 2000 00:00:00"
>
set nextThursday to date string of ,
>
(dref + ((current date) + weeks - dref) div weeks * weeks)
... and with even less maths:
set dref to date "Thursday, 6 January 2000 00:00:00"
tell (current date) to set nextThursday to date string of ,
(it + weeks - (it - dref) mod weeks)
(For digest readers, the "," is supposed to be a line-continuation
character.)
NG