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 23:33:06 -0800
On or near 11/15/00 3:17 PM, Nigel Garvey at email@hidden
observed:
>
set dref to date "Thursday, 6 January 2000 00:00:00"
>
set nextThursday to dref + (round (((current date) - dref) / weeks)
>
rounding up) * weeks
Two lines! Makes us all look like idjits. Maybe it's because it's late and
I've had one too many beers, but would you care to explain that date
calculation, Nigel? The "round" part gets you what? The number of weeks
since the first Thursday of the year, right? What does multiplying that by
"weeks" give you? Ah! The light dawns...it offsets from that reference date
that many weeks, thus giving the next Thursday. Okay, never mind. The
"rounding up" part is necessary because it handles days that are just one,
two, or three sevenths of a week past Thursday, so that starting on a
Friday, you get the date of the Thursday following. Hm. My "explanation"
still reflects one too many beers, but I think I've got it.
--
Peace be with you!
Allen <email@hidden> XNS Name: =Allen Watson
My web page: <
http://home.earthlink.net/~allenwatson/>