A decimal calendar is a terrible idea
Tags: calendars, dates, time
Published: 2022-11-09 16:02:00

---
title: A decimal calendar is a terrible idea
published: true
description: 
tags: calendars, dates, time
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0nee2nsp38dt43jbfp66.jpg
# Use a ratio of 100:42 for best results.
published_at: 2022-11-09 16:02 +0000
---

I was thinking about a decimal clock as totally normal people sometimes do and eventually ended up doing some research about a decimal calendar.

# Why is a decimal calendar a terrible idea

You're probably aware that a year has 365 days (or [365 days, 5 hours, 48 minutes, and 46 seconds](https://www.washingtonpost.com/news/speaking-of-science/wp/2017/02/24/think-you-know-how-many-days-are-in-a-year-think-again/) to be more precise) which is not easily divisible by 10.

Do you divide the year into 10 months of ~36 days? Do you then have 10 weeks of 3.6 days? Or 3 weeks of 10 days? You could keep the 12 months (which doesn't really make it a decimal calendar, does it?) each with 3 weeks of 10 days. You then need a special week at the end of the year for the extra 5 (or 6) days.

Either way, a decimal calendar is way too impractical and not a good idea.

# What about other calendar systems?

Now that we can work with. Throughout my research (which consisted of this Wikipedia page about the [calendar reform](https://en.wikipedia.org/wiki/Calendar_reform)) I found two interesting proposals. The [World Calendar](https://en.wikipedia.org/wiki/World_Calendar) and the [International Fixed Calendar](https://en.wikipedia.org/wiki/International_Fixed_Calendar) which are both perennial calendars, meaning they don't change year to year. November 9 is always a Thursday on the World Calendar and a Monday on the International Fixed Calendar.

# Finding what today is on those calendars

That got me thinking about how you could figure out where a specific date landed on one of those two calendars and then I went coding.

The gist of it is quite simple:

* Calculate which day of the year we're at (ex: 200th day)
* Calculate which date corresponds to that day on the other calendar

There are some quirks to workaround obviously since those calendars still have to deal with leap years and both have an extra day at the end of the year because 365 days is still not divisible in nice regular chunks.

For the International Fixed Calendar the logic is relatively simple (this code doesn't include the logic for the leap year):

```ts
// diffDays is the number of days since the beginning of the year
const dayNumber = (diffDays % 28) + 1;
const dayName = WEEKDAYS[diffDays % 7];
const monthName = MONTHS[Math.floor(diffDays / 28)];
```

For the World Calendar it's a little more complex because some months have 31 days and others 30 days. So the logic goes like this:

* Find the quarter
* Find the month in the quarter
* Find the day in the quarter

```ts
// Determine the month index within the quarter (91 days per quarter)
// and the day of that month (months of 31, 30, and 30 days respectively)
let monthIndex = 0;
let dayNumber = (diffDays % 91) + 1;
if (dayNumber > 31 && dayNumber <= 61) {
  monthIndex = 1;
  dayNumber -= 31;
} else if (dayNumber > 61) {
  monthIndex = 2;
  dayNumber -= 61;
}

const zeroBasedQuarter = Math.floor(diffDays / 91);
const monthName = MONTHS[zeroBasedQuarter * 3 + monthIndex];

const dayName = WEEKDAYS[diffDays % 7];
```

...and that's pretty much it!

You can find the results on a [website I made](https://www.bettercalendars.com/) to show the results and let you check when your birthday is on those calendars.

There's also a [decimal clock](https://www.bettercalendars.com/decimalclock/) if you want to check that out too.