sawyl: (Default)
[personal profile] sawyl
I happened across an interesting new year bug this week. I was investigating why a particular command failed to work correctly when run on the 31st December 2009.

After some digging, I discovered that the command was being passed the date of the next day in month and day format, e.g. "01/01", which appears to have been incorrectly evaluated as "01/01/2009" instead of "01/01/2010". Which indicates that, if the year isn't specified, the command simple tacks on the current year — something that works in every case except where the date crosses a calendar year change.

The solution to the problem seems to me to be relatively simple. Given that, by its nature, the command cannot act on any date that has already passed, it should assume the current year unless the date has already passed, in which case it should assume next year. While not perfect, this should at least avoid triggering problems on New Year's Eve, a time when most good sysadmins are out partying. Or asleep.

But it just goes to show how easy it is, a decade after all that time and money and effort was spent on Y2K, to fail to correctly account for calendar changes.

Profile

sawyl: (Default)
sawyl

August 2018

S M T W T F S
   123 4
5 6 7 8910 11
12131415161718
192021222324 25
262728293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Feb. 4th, 2026 11:40 pm
Powered by Dreamwidth Studios