Date of following week

(imported comment written by SystemAdmin)

JackCoates

holiday awareness is a big deal in maintenance windows and other service management type activities…

We should probably start a new thread on that topic. I can see maybe copying a text file containing the holidays of the calendar year to determine if the maintenance window should be opened or closed. Actually calculating the holiday dates would probably be CPU intensive (like Easter).

(imported comment written by BenKus)

Winner? 72 characters!

(now+(if it=0 then 7 else it)*day)of((Thursday-current day_of_week)/day)

Ben

(imported comment written by JackCoates91)

fine, if you’re gonna take spaces out… 72 characters for me too :slight_smile:

it whose(it as string starts with “Th”)of(now+it*day)of integers in(1,7)

(imported comment written by BenKus)

Fine… How about this (43 characters)…

now+(Wednesday-(current day_of_week))+1*day

Elegant. Simple. Beautiful?

Ben

(imported comment written by SystemAdmin)

For what it’s worth…

Ben’s relevance does seem to evaluate a tad faster (.088ms to .100ms) than Jack (.099ms to .114ms)

However Jack’s relevance is easier to read.

Prior to Ben’s recent posting in the last 10 seconds… This would have been shorter at 70 characters…

it whose(it as string starts with “Th”)of(now+it*day)of(1;2;3;4;5;6;7)

Ben’s could be reduced as 41 as…

now+(Wednesday-(current day_of_week))+day

(I feel like a caddy for this game of golf)

(imported comment written by JackCoates91)

alright Ben, that’s pretty cool.