Category: Life technologies

The invention of the calendar and the doomsday algorithm

Author: Irina Afanaseva
Published: 2025-05-31
Time to read: ~15 minutes

The Roman calendar

was extraordinarily confusing.

Roman generals always won,

but never knew on which day it happened”

Voltaire

Time is never enough. It feels like the new year just started yesterday, and the next one is already looming. Meetings, deadlines, birthdays, vacations — everything blends into a swirling kaleidoscope of events threatening to swallow us whole.

All our lives, we learn to survive this flow, to not lose sight of what’s important, and to keep control over time. But not everyone manages it.

You can create your own personal calendar or use ready-made solutions. You can return to the wisdom of our ancestors and see how they managed their affairs. Or you can turn to modern technology to smartly divide the hours in your day.

As usual, we’re ready to offer you a blend of life experience and cutting-edge technology.

The first calendars appeared back when the sky was thought to be a solid dome, and the Earth — a flat disc resting on whales, elephants, and turtles. Gods periodically sent rain from the heavens and gifted the flooding of rivers, essential for life itself.

Imagine Ancient Egypt. Farmers, worn out from hard labor, live in anticipation of the fertile Nile’s flood — it breathes life into all the fields. Then suddenly, a man appears and declares, “In four days, the Nile will overflow its banks!” And exactly four days later, a miracle happens — the flood, vital for Egyptian agriculture, arrives right on time.

The secret of this miracle is simple — the man who predicted the flood possessed knowledge of celestial movements and nature’s cycles, enabling him to foresee events ordinary mortals could not. Soon, this same man proclaims, “A drought will come in two days!” The prophecy comes true again, and he quickly rises to become a priest — a mediator between gods and people.

“Knowledge is power!” Francis Bacon wisely said. But people understood this truth long before him. The knowledge hidden in calendars became a powerful tool of authority and progress in the hands of the chosen few. That’s why priests guarded it fiercely, keeping it secret from the uninitiated.

Time Refuses to Be a Whole Number

It takes exactly 365 days for the Earth to complete a full orbit around the Sun. But in reality, the time of one full revolution is 365.242195 days.

Despite these precise calculations, the ancient Egyptian calendar consisted of 365 days, effectively “stealing” about six hours each year. The culprits? The gods. Each month had 30 days, but at the end of every year, five festival days were added, dedicated to specific gods. Over four solar years, the unaccounted quarter-day accumulated, nearly forming a whole day, gradually pushing the day of the Nile flood further away.

Attempts to fix the calendar met with outrage and fanaticism from the priests: the clergy forbade interfering with the will of the heavens. They introduced a coronation ritual oath, where kings promised not to alter the established calendar order — to add nothing and keep the year exactly 365 days long.

Still, a breakthrough effort was made. Pharaoh Everget introduced the leap year, and the Egyptian calendar stopped shifting. But the priests’ demands proved stronger than common sense, and the corrected calendar died along with Everget.

The Mathematics of Time

Ancient astrologers firmly believed that human destinies were closely tied to the influence of celestial bodies: the Sun and the Moon. Each luminary ruled over its own day of the week, shaping its character and events. To this day, many languages name the days of the week after Roman gods — the rulers of the planets.

The order of the days in the Roman system was based on the so-called Chaldean sequence — the arrangement of celestial bodies according to the decreasing length of their orbit around the Earth: Saturn, Jupiter, Mars, Sun, Venus, Mercury, Moon.

But four thousand years ago, in the cradle of astronomy — the city of Babylon, among clay tablets and mysterious pyramids — the idea of a seven-day week was born. The number seven was sacred to the Babylonians. They used it in religious rituals, governance, and in attempts to comprehend the cosmic order. Gradually, the seven-day week, like a seed, sprouted through the centuries and reached Greece and Rome, though it had to make way for ten-day and eight-day variants along the way.

However, not all ancient civilizations immediately embraced the new format. The Egyptians preferred a ten-day cycle, while the Chinese used a sixty-day period. According to the Chinese system, a new sixty-day cycle began on December 26, 2024; its last day would be February 23, 2025. Several months were encompassed within this cycle.

A Journey Through Timekeeping Systems

Europe lived by its own rules of time. In different corners of this continent, the Julian calendar — the brainchild of Julius Caesar — reigned supreme.

The new year began on January 1st, symbolizing the start of the Roman consuls’ rule. This remained so until 1582, when Pope Gregory XIII introduced the Gregorian calendar in Catholic countries.

There was a significant difference between the two calendars — primarily concerning the length of days. It is commonly accepted that a day lasts 24 hours, though in reality, the Earth completes a full rotation in approximately 23 hours, 56 minutes, and 4 seconds. To compensate for this discrepancy, the Julian calendar declared every fourth year a leap year. Yet, these calculations couldn’t prevent the accumulation of errors over time.

The Gregorian calendar, introduced in 1582 by Pope Gregory XIII, was a revolutionary step that corrected the accumulated mistakes of the Julian system. Around the same time, a new rule for leap years was established: centuries divisible by 100 would not be leap years unless they were also divisible by 400. Therefore, the years 1700, 1800, and 1900 were common years, even though the Julian calendar considered them leap years. Conversely, 1600 and 2000 remained leap years because they were divisible by 400.

This refinement was necessary because the 10-day difference between the calendars could cause confusion in agricultural activities — and every miscalculation could cost farmers their harvest. The Gregorian calendar helped people better align with natural cycles.

The Polyphony of the Maya Calendar

In pre-Columbian Mesoamerica, the Maya calendar was the central player in how time was understood and measured. Here, individual dates mattered less than a complex system made up of many interlocking parts.

It’s known that there were two main calendars. The civil calendar counted 365 days, divided into 18 months of 20 days each, with an additional five “unlucky” days at the year’s end. This version mattered most for agriculture and daily life.

The Sacred calendar had 260 days, numbered from 1 to 13, each day carrying a symbolic name and repeating every 20 days. This calendar was used for religious ceremonies, prophecy, and determining fate.

The Maya tribe also had a third way of measuring time — a cycle of 819 days. This number was part of a larger cycle lasting 3,276 days, or nine times 364 days. One might guess that every nine years, something special happened in the Maya world.

There’s also a cosmic explanation for this system. Suppose nothing extraordinary took place at the end of the 3,276-day period. Instead, this was a convenient number — the synodic period during which planets moved around the Sun, each at its own pace, in their usual direction, completing their orbits. The Maya wrapped it all up so cleverly that even modern scientists with powerful computers still struggle to fully understand this ancient calendar system.

Australian Harmony with Eternity

“No measure of time — no exact calendar,
no months or years. No calendar — no history”

Found somewhere on the internet

The life of ancient Australians was deeply connected to the surrounding landscape. They had no agriculture — the usual driver of calendar cycles. There were no drastic seasonal changes in weather. There was no need to store food or sew warm clothes for winter, and so no need for an exact reckoning of time.

Instead, animal behavior served as their guide. Seasonal names often referred to animals and birds, like “the season of mating turtles” or “the season of goose eggs.” This was how they determined the best time for hunting and gathering. Some tribes in northern Australia recognized up to seven such “seasons.”

The Flaws of the Calendar

It would be nice if time flowed smoothly and predictably, and every month resembled the next — making planning intuitive. But instead, we deal with a capricious calendar that adds or removes days at will. The recurring dates fall on different weekdays each year, shifting continuously.

This happens because a year doesn’t consist neatly of 52 weeks; sometimes one or two extra days sneak in. For example, January 1960 had 25 working days, while a year later, it stretched to 26. Sundays might occur four times in one month, and five times in another.

Floating days do cause real headaches in workplaces. Scheduling a large team’s work becomes much harder when the month shortens or lengthens. Companies routinely rewrite plans, recalculate salaries, and reshuffle vacation schedules. Planners and engineers rise to the challenge gracefully — but why not simplify their job if we can?

Oh, if only all months were identical, and each weekday forever attached to a specific date. For example, the 1st would always be Sunday, the 2nd Monday, the 3rd Tuesday, and so on, every month. Comfortable as your favorite slippers. Maybe it’s time to consider a new calendar — one that shows time and saves it at the same time.

“Leap through time like hopping on stones
across a river — and you won’t fall”

Mathematician John Conway

Calculating calendar days used to be terribly tedious: you had to cycle through months, days, leap years… Trying to figure out the day of the week for a given date seemed impossible. Everything changed when the “Doomsday Algorithm” appeared.

It was invented by the brilliant British mathematician John Conway. He figured out how to shrink monthly calculations into just a few steps while keeping perfect accuracy. When Conway first started thinking about the Doomsday Algorithm, he fell in love with the idea and wanted people to see that calculating weekdays isn’t boring math — it’s almost like magic. He showed up at parties, gave lectures, or just popped into someone’s home saying, “Name any date in any year, and I’ll tell you what day of the week it was!”

At first, people were confused. Then they’d say something like “November 15, 1782,” and Conway would, in about 10 seconds, tell them the correct weekday. Everyone was shocked, thinking it was some complicated trick. But in reality, Conway had a super-trained mental system: he knew the “doomsdays” by heart and could quickly add and shift dates in his mind. He even trained like an athlete—sitting at home with a timer, running through 50–100 dates a day to boost his speed.

Conway always said that anything you can turn into a game will stay with you forever. And so, the fun “game of time” was born.

The story behind the algorithm’s name is even funnier — and has nothing to do with the apocalypse. John Conway noticed that every year has a special “Doomsday” — a particular weekday that acts like an anchor for all the key reference dates. This day is the ultimate “judge” that helps figure out what day of the week every other date falls on. So the dramatic name actually has a kind, helpful meaning.

It’s worth mentioning that Conway loved giving his discoveries catchy, slightly mystical names so they’d stick in people’s minds forever. He invented the “Game of Life,” “Crazy Numbers,” and “Surreal Numbers”: a little science + a little play + a whole lot of passion.

The Doomsday Algorithm is like a game too — all you need to succeed is to remember the “anchor” year, the “Doomsday” itself, and learn how to shift all the other dates from there.

The main idea of the algorithm is that every year has special “anchor dates” that always fall on the same weekday. For example:

  • 4/4 — April 4
  • 6/6 — June 6
  • 8/8 — August 8
  • 10/10 — October 10
  • 12/12 — December 12
  • 5/9 — May 9
  • 9/5 — September 5
  • 7/11 — July 11
  • 11/7 — November 7 
  • And also: Pi Day (March 14 in common years) or February 28 (in leap years).

And every year has its own “Anchor Day” — the “Doomsday.” In 2024, the Doomsday falls on a Thursday. For the next few years, just remember this:

  • 2024 ➔ Thursday
  • 2025 ➔ Friday
  • 2026 ➔ Saturday
  • 2027 ➔ Sunday
  • 2028 ➔ Sunday (leap year)

Each year, the Doomsday shifts forward by one weekday — but after a leap year, it jumps by two.

To quickly figure out any date’s weekday, just find the nearest anchor date, count the days difference, shift the weekday by that number, and voilà! Anchor → Difference → Answer.

Bet you can do this in your head right now — what day of the week will September 7, 2026, fall on?

  • First, find the anchor date close to September 7 — that’s September 5
  • Remember the 2026 anchor day is Saturday
  • Calculate the difference: September 7 is 2 days after September 5, so shift the day by 2. Since September 5 is always Saturday, then September 6 is Sunday, and September 7 must be Monday.

Boom! We just predicted the future: September 7, 2026, will be a Monday.

Now let’s try predicting the past and find out what day July 4, 1776, fell on.

  • First, remember that July 4 itself is an “anchor day.”
  • Recall that the century anchor for the 1700s is Sunday.
  • Next, calculate the offset between the year’s anchor day and the anchor date:
    • To do this, take the last two digits of the year 1776 — that’s 76 — and divide by 12. You get 6 whole dozens and a remainder of 4;
    • Then count how many leap years passed between 1700 and 1776. Divide 1776 by 4 and 1700 by 4. You get two numbers: 444 and 425; their difference is 19 (444 – 425 = 19);
    • Add these up: 6 + 4 + 19 = 29;
    • Now do modulo 7 to find how much to shift from the anchor day: 29 mod 7 = 1.
  • Shift one day forward from the anchor — Sunday.
  • And voilà! July 4, 1776 was a Monday.

Bravo! We’ve predicted the past!

The beauty of this elegant algorithm is that it’s always at your fingertips — or rather, in your head. Once you master the Doomsday Algorithm, you can amaze your friends and acquaintances with your prophetic skills.

If you want to practice quickly and easily guessing the day of the week for any date, here’s a simple trainer:

Step 1: Determine the century anchor day

1600s → Tuesday

1700s → Sunday

1800s → Friday

1900s → Wednesday

2000s → Tuesday

2100s → Sunday

2200s → Friday

2300s → Wednesday

2400s → Tuesday

2500s → Sunday

3000s → Tuesday

You can remember that the anchor repeats every 400 years thanks to the Gregorian calendar cycle.

Step 2: Calculate the Year Offset Within the Century

Take the last two digits of the year (yy) and do the following:

  1. a = yy // 12
  2. b = yy % 12
  3. c = b // 4
  4. year_offset = a + b + c
  5. weekday_offset = (century_anchor + year_offset) % 7

Step 3: Find the Doomsday Date for the Month

For leap years: January = 4, February = 29

 Step 4: Compare Your Date with the Anchor

  • Subtract or add the difference in days between your date and the month’s Doomsday.
  • Move forward or backward that many days from the `weekday_offset`.
  • Voilà — you get the day of the week, along with universal admiration and respect.

Tables and Discs

Tabular calendars cover the period from 1901 to 2096. With the help of a simple numeric grid, you can easily find out what day of the week you were born on or which day your wedding date will fall. All you need to do is find the year and month in the table, add the day according to straightforward instructions, and voilà — you get the weekday corresponding to your chosen date.

Back in the day, these tabular calendars were printed in books and newspapers; people would cut them out to always have their personal time oracle at hand. Using perpetual disc calendars makes the math even simpler. By rotating the disc, the user aligns the year with the month, instantly unlocking the calendar grid for that specific month. With it, you can quickly and effortlessly determine the day of the week for any date — past or future.

The Slavic Calendar at Your Fingertips

We can also journey back to a world where time wasn’t abstract numbers, but a living matter pulsing right in your hands. The Slavs used a system of measuring time called “vrucyeleto” — literally “the year in the hand.” This system had no numbers, only letters.

Each finger joint, each section of the palm became a keeper of days, marked by the first seven letters of the Slavic alphabet: A, B, G, D, E, S, and Z. For example: March 1 corresponded to the letter G; March 2 to V; March 3 to A; March 4 to Z; March 5 to S; and so on, cycling backward through the alphabet.

Old church books show that each year was marked by a letter indicating Sunday — called the “vrucyeleto of the year.” So, if the letter was V, Sundays fell on March 2, 9, and 16.

You could calculate other weekdays using the finger joints:

 A — the knuckle closest to the palm

 B — the second knuckle

 G  — the third knuckle

 D  — the fingertip

 E — the top knuckle on the back of the finger

 S — the middle knuckle on the back of the finger

 Z — the knuckle near the palm on the back of the finger.

At the heart of this system lay a mathematical principle of cyclic repetition, quickly determining weekdays for any year within a 28-year cycle. You could literally feel the flow of time on your skin. The Slavic calendar is one of those timeless tools for tracking time — still perfectly usable today. The older generation can guide and advise, as they surely know how to count days in a month using the knuckles on their hand.

The Code of Time

The Unix time system was launched over half a century ago — back when there were neither smartphones nor the internet as we know it today. This new technology gave programmers the power to synchronize and work with the same timeline across different time zones, without the headache of manually adjusting clocks.

And we’ve all become part of this system, every time we interact with a computer or smartphone. Starting from January 1, 1970, a relentless second counter ticks away, marking every single moment. This count doesn’t depend on religious or cultural contexts, because it’s anchored to one specific event — the Unix epoch.

Why count in seconds? It turns out storing one big number representing total seconds takes much less space than storing separate values for year, month, day, hour, minute, and second.

Unix time takes up only 4 or 8 bytes, making it perfect for handling huge amounts of dates and timestamps efficiently across many programming languages.

In Python, you can use functions like time.time () or datetime.timestamp().

In Linux and macOS, system calls like time() or gettimeofday() provide access to the current time.

Unix time is the backbone technology of the modern digital world — running time on a whole new level.

The French 10-Hour Alternative

An alternative way to measure time was proposed during the French Revolution but never gained widespread use. In the French system, the new calendar started on September 22, 1792 — the day the First French Republic was declared.

The calendar year had 12 months, each divided into 3 weeks of 10 days each. A day had 10 hours, each hour had 100 minutes, and each minute had 100 seconds. The extra 5 days in the year were reserved for holidays.

Maybe we should also pay some attention to this 10-hour system. It opens new possibilities for scientific research. The compactness and logic of the French calendar format simplify complex calculations and data analysis.

The International Fixed Calendar in Business

The International Fixed Calendar is often called the “13-month calendar” or the “calendar of equal months.” It was proposed by Moses Cotsworth in the early 20th century as an alternative to the traditional Gregorian calendar.

The core idea is to divide the year evenly: it has 13 months of 28 days each, and every month has exactly 4 weeks. Because of this, each month always starts on a Sunday and ends on a Saturday. This makes the calendar perfectly predictable: for example, if the 1st day of the month is a Sunday, it will be so in every month, every year.

To keep the calendar aligned with the astronomical year, one extra day — outside of months and weeks — is added at the end of the year. In a leap year, two extra days are added. These days are considered “outside the weekly framework” to maintain the regularity of the structure.

This calendar was proposed as more convenient for business and planning because fixed weekdays for dates simplify accounting and scheduling. It makes it easier to compare months, eliminates “floating” holidays and dates.

Cotsworth’s idea gained support among industrialists and businessmen. One of its most famous advocates was American entrepreneur George Eastman — founder of Eastman Kodak. In 1928, Kodak even officially adopted the International Fixed Calendar inside the company — employees used it for over 30 years.

The idea also found backing among some economists, rationalizers, and supporters of a global calendar standard. In the early 20th century, even the League of Nations considered calendar reform proposals, including Cotsworth’s system; however, due to resistance from religious organizations and states, the reform was never adopted.

The calendar opened the door to the world of planning and predictions, becoming perhaps even more significant an invention than the wheel. At the dawn of civilization, it transformed perception by helping to build and develop agriculture, cultivate holidays, and shape social bonds. Now we can confidently say that the calendar is no longer just a familiar sheet of numbers — it is a true time machine that allows us to connect the past with the present and build the future.

The Roman Empire has fallen. But we have scientific content that doesn’t survive, it triumphs!

Thank you!

smile

Similar articles | Solutions