How Come The Application Broke?

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 1st! Doh! Sadly... there is no 13th 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?!!!!!
Comments are closed

About Me

Nick Schweitzer Nick Schweitzer
Wauwatosa, WI

Contact Me
I'm a Software Consultant in the Milwaukee area. Among various geeky pursuits, I'm also an amateur triathlete, and enjoy rock climbing. I also like to think I'm a political pundit. ... Full Bio

Community Involvement

Twitter

Archives

Flickr Photos

www.flickr.com
This is a Flickr badge showing public photos and videos from Nick_Schweitzer. Make your own badge here.

Standard Disclaimers

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2012 Nick Schweitzer