black flat screen computer monitor

Zeller’s Formula

Have you ever come across Zeller’s formula (aka Zeller’s congruence)? If not directly, you will have indirectly.

For every digital device you have that shows the day of the week, whether your phone or your computer, there’s a chance this is what powers it. Or a variation of it, at least. Created by Christian Zeller in the 17th century, it’s a set of formulas that let work out the day of the week, based on the provided date.

I came across it a long time ago – maybe nearly 30 years ago (December 1999 looks to be a good candidate). I was called into work on Boxing Day, as the week-ending software in stores wasn’t working as it should.

Many years previous, somebody had uses the formula to work out when the end of the week was (Sunday) so that stock-taking and accountancy software could run in each of the retail stores. But they’d used a floating point variable that, for some time, had been sufficient in size. Until now. Now it had overflowed, creating an incorrect result, and didn’t think that Sunday was, indeed, Sunday.

A quick change to that variable definition, a re-compile, test and, finally, push to all stores was the fix. As far as I know it’s still going today and with no further changes needed.


Discover more from artiss.blog

Subscribe to get the latest posts sent to your email.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.