Date Fun
By: Brad Graham
I was trying to figure out a way to quickly determine a date's day of the week using some kind of formula. To start, I figured there were a few things we already knew without having to look at a calendar:
- There are 7 days a week
- There are 12 months
- Every 4th year is a leap year
- The 1st of the month day of the week is the same as the 8th, 15th, 22nd, and 29th.
With this basic understanding, it became clear that at least some month's days of the week were similar. I decided to first see out what months had similar date structure during a non-leap year:
- January, October
- February, March, November
- April, July
- September, December
- The 1st of June, August, and May all fall on their own days, and don't share with anyone. We call these brats.
Then I figured we need to know the leap year date structure (damn you, February!):
- January, April, July
- February, August
- March, November
- September, December
- The brats now: June, October, and May
Getting them in a weekly order I could remember seemed like a good idea, so I first tried by putting January first (imagine this as Monday-Sunday):
- January, October
- May
- August
- February, March, November
- June
- September, December
- April, July
That's okay, but I think it might be better if January was in the middle, so I could do a max of 3 days before / 3 days after:
- June
- September December
- April, July
- January, October
- May
- August
- February, March, November
That's better, but that stinking leap year is really going to make things look nasty. So maybe I need another date to start with. Let's go with March 1st instead, since there's only two months ahead of March, and everything after it will remain the same format on leap years:
- January, October
- May
- August
- February, March, November
- June
- September, December
- April, July
Oh, I like that. It's sandwiched by a few of the brats, so that's easy to remember. Plus, March shares it's days of the week with two other months, so that's pretty good. So the first of the month for a random year might look like this:
- Sunday: January, October
- Monday: May
- Tuesday: August
- Wednesday: February, March, November
- Thursday: June
- Friday: September, December
- Saturday: April, July
The cool thing is, every three non-leap year years March 1sts are sequential, so if it were a Wednesday this year, it'd be a Thursday the next year. And even on leap year's it just jumps an extra day, like going from Wednesday one year to Friday the next. Not bad.
Really, all you have to do is memorize these layouts, which might take thirty minutes or so:
Non-Leap Year:
- January, October
- May
- August
- February, March, November
- June
- September, December
- April, July
Leap Year:
- October
- May
- February, August
- March, November
- June
- September, December
- January, April, July
Or just buy a freaking calendar.