Security News > 2020 > January > Is the Y2K bug alive after all?

Is the Y2K bug alive after all?
2020-01-10 16:55

In some years, the answer comes out exactly one year off for just a few days at the start or the end of the calendar year.

The bug in the Java case is that Java's shorthand to denote the current year in four digits is yyyy, and not YYYY - it really matters whether you use capital letters or not.

So if there are an odd few days at the start or end of a year, they're transferred to the previous or following year when you count in weeks to do your accounts.

There was a downside there, namely that you no longer had any way of denoting the year 1900, but that was often much less of a problem than not being able to recognise 2000 - you accepted the risk of very occasional bugs that might never show up, instead of facing certain disaster at the stroke of midnight on New Year's Day in Y2K. Of course, this trick could be used to give you more than one extra year - at the end of 2000, for example, if you still hadn't managed to fix your software with four-digit years, you could push the cutover point to the end of 2001 instead - you'd lose 1900 and 1901 but gain 2000 and 2001 instead. You can guess where this is going, namely that what works for one or two years can work for 10 years.

If the devices suffered a 100-year calculation error at the transition from 2019 to 2020, then you might reasonably expect the system to have failed on New Year's Day, rather than on the second day of the month.


News URL

https://nakedsecurity.sophos.com/2020/01/10/is-the-y2k-bug-alive-after-all/