The ingenuity displayed so far is impressive, but IMHO it is far easier just to create a new table with dates, week numbers, the day of the
week, etc. And while we're on the subject, what demented programmer came up with CalBasics?!
Hold on, we did not yet discuss the role of leap seconds in this context.