by Nick
Wednesday, November 02, 2005 4:59 PM
Today one of my project leaders came by and asked for help figuring out why one of our production systems that I helped work on broke suddenly. We hadn't touched the code in months, so we had no clue what would have suddenly changed. My initial thought was that because it threw an unknown exception at application startup, some needed libraries had been removed or something. After doing a couple minutes of debugging, we found out the problem was a little simpler than that:
StartDate = New Date(Now.Year, Now.Month + 2, 1)
EndDate = Date.Now.AddMonths(2)
And yesterday was November 1
st! Doh! Sadly... there is no 13
th month in the year, and the Date constructor doesn't rollover properly in this case. Thanfully I didn't write this code... but still had to help fix it. Don't you hate it when really trivial stuff kills you? Hmmm... sorta like
Office Space:
Michael Bolton: Ok! Ok! I must have, I must have put a decimal point in the wrong place or something. Shit. I always do that. I always mess up some mundane
detail.
Peter Gibbons: Oh! What is this fairly mundane detail, Michael?!!!!!