All posts

The Time We Deleted Eleven Days from Production

Or: How Humanity Performed the Largest Calendar Data Correction in History

Imagine waking up one morning to discover that your database administrators have deleted eleven days from reality.

Not metaphorically.

Not symbolically.

Actually deleted them.

You go to bed on September 2nd.

You wake up on September 14th.

Your birthday? Gone.

Your anniversary? Gone.

That project deadline you were dreading? Also gone.

Welcome to 1752. Though, in actuality, there was a year or two notice.

This isn’t a science fiction story. This isn’t a bug in Outlook. This isn’t an AI hallucination.

This is something humanity actually did.

The Original Bug

Back in 46 BC, Julius Caesar rolled out a shiny new calendar.

We’ll call it Calendar v1.0.

The Julian Calendar assumed a year was 365.25 days long. For the technology available at the time, this was pretty impressive. Ancient astronomers didn’t exactly have atomic clocks, GPS satellites, or angry project managers demanding status updates every Tuesday.

By the 1500s, Europe was using the Julian calendar. The actual tropical year (the interval between one vernal equinox — the first day of spring in the Northern Hemisphere — and the next) is about 365.2422 days long. That difference is only about 11 minutes per year, but over centuries it accumulated. By 1582, the calendar had drifted about 10 days relative to the seasons. Easter and other church observances were occurring progressively farther from the astronomical events they were intended to track.

The difference is tiny.

About eleven minutes per year.

Eleven minutes doesn’t sound like much. Most people spend longer than that deciding what to watch on Netflix.

But, small errors have a way of accumulating.

Ask anyone who has ever worked with floating-point math.

Technical Debt: The Original Version

For centuries, nobody really noticed.

The seasons still happened.

Winter remained committed to making everyone miserable.

Summer continued producing mosquitoes.

Life went on.

But, every year, the calendar drifted a little farther from reality.

After a few hundred years, church officials began noticing that important religious dates were slowly wandering away from the astronomical events they were supposed to track.

The calendar was technically functioning; it was just functioning incorrectly, which, as every software engineer knows, is the worst kind of functioning.

The Bug Report Arrives

By the 1500s, the accumulated error had reached approximately ten days.

The calendar and the Sun were no longer in agreement.

One can only imagine the meeting.

Astronomer: “Your Holiness, we appear to have accumulated roughly sixteen centuries of date drift.”

Pope Gregory XIII: “How bad is it?”

Astronomer: “About ten days.”

Pope Gregory XIII: “Can we patch it?”

Astronomer: “…define patch.”

The Production Fix

The solution was wonderfully simple.

And by simple, I mean horrifying.

In October 1582, several countries simply skipped ten days.

In 1582, Pope Gregory XIII introduced the Gregorian calendar.

The solution was surprisingly blunt:

  • Thursday, October 4, 1582
  • was immediately followed by
  • Friday, October 15, 1582

Ten calendar dates simply disappeared. October 5–14, 1582 never existed in countries that adopted the reform immediately.

Imagine going to bed on October 4 and waking up on October 15.

Thursday, October 4th was immediately followed by Friday, October 15th.

October 5th through October 14th ceased to exist.

Imagine deploying that change today.

Release Notes

Version: Gregorian Calendar 2.0

Changes:

  • Fixed date drift issue.
  • Removed ten obsolete days.
  • Improved leap year calculations.
  • Updated Easter scheduling algorithm.
  • Various astronomical performance improvements.

Known Issues:

  • Users may experience confusion.
  • Historians may become angry.
  • Existing documentation may be inaccurate.
  • Time itself may feel slightly suspicious.

The Distributed Systems Problem

Naturally, not everyone upgraded at the same time.

Because, of course, they didn’t.

Spain upgraded.

Portugal upgraded.

Italy upgraded.

These countries were predominately Catholic at the time and aligned closely with the Vatican in Rome.

England looked at the release notes and apparently decided that they’d wait for Service Pack 1.

This created one of the most spectacular synchronization problems in history.

Different countries were now using different calendars.

The same day could have two different dates depending on where you lived.

It’s basically the equivalent of running half your servers on one schema and half on another.

What could possibly go wrong?

Britain’s Migration Project

Britain eventually upgraded in 1752.

By then, the accumulated error had grown to eleven days.

So Britain executed perhaps the most aggressive data correction ever performed.

September 2nd, 1752…

became…

September 14th, 1752.

Eleven days vanished.

Imagine explaining this to your accounting department:

“Where’s the invoice from September 7th?”

“There was no September 7th.”

“What do you mean there was no September 7th?”

“We deleted it.”

“You deleted a date?”

“Yes.”

“Can you do that?”

“Apparently.”

Historical Records

One of the more entertaining side effects is that historians still deal with date conversion issues centuries later.

Events recorded in one country might need conversion when compared with records from another.

Birthdays become complicated.

Death dates become complicated.

Everything becomes complicated.

It’s the same challenge modern engineers face when merging logs from systems that disagree about timestamps.

Only instead of servers, the systems are entire nations.

And instead of milliseconds, they’re disagreeing by nearly two weeks.

Most historical events did not get renamed or redated. Instead, historians usually keep dates in the calendar system used at the time and note the conversion when necessary.

Some examples:

  • The assassination of Julius Caesar is still generally discussed using the date historians traditionally assign.
  • Medieval events are usually referenced using the calendar system in effect where and when they occurred.
  • The Russian October Revolution is a famous oddity. It occurred on October 25, 1917 (Julian calendar) or November 7, 1917 (Gregorian calendar). The revolution is still called the “October Revolution” even though it occurred in November according to the calendar we use today.
  • Shakespeare and Cervantes — The Famous Example: Both William Shakespeare and Miguel de Cervantes are often said to have died on April 23, 1616. Technically, they did not die on the same actual day. Spain was already using the Gregorian calendar, while England was still using the Julian calendar. The dates were about 10 days apart at that time.

Historians often distinguish between:

  • Old Style (OS) — Julian calendar
  • New Style (NS) — Gregorian calendar

For events near the transition period, both dates may be shown.

This Feels Familiar

The whole story feels surprisingly modern.

The bug was tiny.

Nobody noticed initially.

The error accumulated slowly.

Technical debt piled up.

Eventually the discrepancy became impossible to ignore.

Then, came the emergency migration project.

Then, came the documentation nightmare.

Then, came decades of cleanup.

In other words, it was exactly like every enterprise software project ever created.

The Largest Data Correction Ever

Today we think of data corrections as things that happen inside databases.

A company fixes customer records.

An application corrects timestamps.

An operating system patches a bug.

But the Gregorian calendar was different.

Humanity discovered a flaw in a system used by millions of people.

The bug had existed for over 1,600 years.

The correction required changing how entire civilizations recorded time.

And the fix involved deleting days from existence.

Not files.

Not records.

Days.

That’s a level of production change modern engineers can only dream of.

The next time someone tells you a database migration is risky, remember that in 1752, an entire country looked at eleven days on the calendar and collectively agreed, yeah, we don’t need those.

Summary

Imagine the world discovered tomorrow that our clocks were drifting by a few seconds each year. After a thousand years, noon would no longer be near the sun’s highest point.

The Gregorian reform was essentially the 16th-century version of a massive production outage fix. We had accumulated a small bug for 1,600 years. The patch is to delete ten days from October. Please update your paperwork accordingly.

And remarkably, it worked. The Gregorian calendar is still the civil calendar used by nearly the entire world today (Iran and Afghanistan use the Solar Hijri calendar, Israel uses the Hebrew Calendar for some religious observances, various religions have their own calendars that date back many centuries, other than that, all Gregorian, baby).

Notes

  • AI / GenAI / ChatGPT / etc were not used to generate the text of this article.
  • ChatGPT was used to generate the images.
  • I used em dashes in my writing before the current GenAI wave was a thing. Not planning on changing now.
  • Names have been changed to protect the guilty.
  • None of the hostnames or users used in examples actually exist.
  • Feel free to post any comments or suggestions below.

Originally published on Medium.