# One, two, and three weeks from now

I just came across this note in my office!

Date of writing: Sept. 9th, 2015

In exactly one week from today, and then a week from that date and then another week afterwards, something will happen that causes certain badly designed computer programs to function improperly on those days.

It happens those three days and no other days in the year 2015. In any given year it will happen in exactly three days out of the year.

What might this finicky event be?

• Exactly one week from today is my birthday! Is that just a red herring? Sep 9, 2015 at 22:30
• Yeah, that's got nothing to do with it.
– user88
Sep 9, 2015 at 22:53
• Sorry if you dislike my edit, it was the easiest way I could put in the proper dates with adding meta information Sep 10, 2015 at 1:41
• Question: is it the same days each year? Or do they differ each year? Sep 10, 2015 at 1:52
• Questions: Do we need some country-specific knowledge or will it only happen in certain countries? Does the problem occur at a specific time, or all throughout the days? Sep 10, 2015 at 2:29

Every Wednesday in September with a double digit for the date. Programs writing out the date like "Wednesday September 16th, 2015" will have the longest print on these days because Wednesday and September have the most letters out of the days of the week and months of the year respectively. For the above example format, if the print buffer is a char[30], there will be a buffer overflow for these three days of the year.

if(strcmp(dayoftheweek,"Wednesday")==0 && (day==16||day==23||day==30) && monthoftheyear%2==1)destroyEverything();

Explanation:

This line of code snuck in by a mischievous programmer would make any program fail three days of every year. Every year has two months where the Wednesdays fall on the 16th, 23rd, and the 30th, and they fall on even and odd months. Last year's occurred in July. (Note: leaving out platform-specific access of date information)

• That's a bit too roundabout. The error I'm thinking of was an innocent error, not something deliberately contrived like that one.
– user88
Sep 10, 2015 at 3:51
• I'll give you a hint, though: you're on the right track thinking about Wednesdays.
– user88
Sep 10, 2015 at 3:53
• Your answer is now correct. It's actually based off of this answer to an old, closed StackOverflow question. I posed it as a question to somebody, to guess what sort of bug they might have gotten with the date, and thought, hmm, this might make a good puzzle.
– user88
Sep 10, 2015 at 3:59
• @CodeNewbie C strings have a null byte to indicate the end of the string. Sep 10, 2015 at 5:18
• @CodeNewbie TIL what TIL stands for! Sep 12, 2015 at 16:55