Skip to content
CONTACT

Law of the treacherous calendar

PROGRAMMING AND BUGS

Any program that handles dates will work all year round, except on 29 February, on the night the clocks change and on the first day of January.

— Anonymous, computing folklore
VIDEO.EXE16:9

Time seems simple. Sixty seconds, sixty minutes, twenty-four hours. Then a programmer tries to handle it in code and discovers the horror: leap years, time zones, summer time, twenty-eight-day months, countries that change their minds.

The result is software that works beautifully three hundred and sixty-two days a year. On the other three it does things out of a Gothic novel: bookings in the past, payslips with a phantom hour, deadlines set for 30 February.

One night at the end of October, one of my management systems recorded the same clock-in twice, at half past two, because that hour really had existed twice. The employee appeared to be in two places at once. The director wanted to promote him. I fixed the bug, with the regret of someone who has destroyed a miracle.