Gregorian misery

The Gregorian calendar has been in use since 1582. Among its features is a moderately complicated rule for leap years: if n mod 4 is 0, then n is a leap year. However, if n mod 100 is 0, then n is not a leap year, unless n is a multiple of 400.

In addition, we live in a world with timezones and regional differences in when countries go on and off daylight savings time, if they have such a system. As yet another example of Japanese rationality, Japan does not have a DST system.

Implementing date and time computations correctly can be very hard for computer programmers and is invariably a source of many hidden bugs that may take a long time to discover. Yesterday, a large amount of Sony’s Playstation 3 game consoles stopped working normally. ┬áThis was later fixed. There was speculation the error was due to incorrect leap year handling. It wouldn’t be the first time this occurred if this was indeed the reason.

In a software company where I used to work, there would usually be massive troubles every time some country went on or off daylight savings time, or any other time calculation hit a sensitive spot. I’m fairly sure that the world’s software systems, including government, finance, insurance, health care, suffer untold billions of damage every year due to the complexity of the system. Maybe we should simplify it.

I suggest having “years” with 365 x 4 + 1 = 1461 days instead of the usual year for starters. This would move the leap year problem ahead until year 2100, when the next special rule comes in. By that time, software engineering technology should have improved enough that this should no longer be an issue, I hope. If not, we can invent another system by then. Let’s also scrap all daylight savings time everywhere. It’s easy to do and the savings would be huge.

Category: Software development | Tags: , 3 comments »

3 Responses to “Gregorian misery”

  1. Christian

    DST is a nice system for people who care about sunlight more than about billions wasted on software engineering. Obviously we could just change our rhythm of life (and thus working hours) based on the sun instead but two “global” shifts a year seem more efficient than millions of local ones.
    The calendar may be flawed, but changing a 500 year old tradition because 50 year old technology cannot deal with it? ;-)

  2. johan

    The Gregorian system is more difficult to describe, hence inelegant (for a man-made formal system that pretends to be precise and universal).
    Also, many people spend most of their working hours indoors. They ought to be able to appreciate it if those hours coincide less well with sunlight!

  3. johan

    … or software engineering could just finally grow up.

Leave a Reply

Back to top