Julian vs Gregorian Calendar

Julian calendar

The Julian calendar was introduced in 45BC by Julius Caesar, taking over from the Roman calendar.

Under the Julian calendar each year has 365 days, except for a leap year every four years which has 366 days.  This averages to 365.25 days.  This however does not approximate the actual tropical year (e.g. based on the cycle of the seasons) close enough.  Specifically the average year was slightly longer than it should have been (365.24219).

So how bad is the Julian calendar?
365.25 - 365.24219 = 0.00781 days
0.00781 * 24 * 60 = 11.2464 minutes
It was gaining about 11.2464 minutes per year.  Hardly consequential - right?  Well, that results in an increase of 1 day every 128 years or so.  By now (2017) it would be 13 days out.  Though after 46,766 years (or so) the Julian calendar would be correct again...

Gregorian calendar

The problem was (mostly) corrected with a new calendar introduced by Pope Gregory XIII in 1582 to reform the Julian calendar.  That calendar, the Gregorian calendar is the calendar we use today.

The Gregorian calendar fine tunes the specification of leap years as:
  • A leap year every four years when the year is exactly divisible by four.  For example 2016 was a leap year.
  • Except for years exactly divisible by 100.  So, 2100 would not be a leap year.
  • However years exactly divisible by 400 are leap years.  So 2000 was a leap year.
This logic results in the average year being:
365 + 1/4 - 1/100 + 1/400 = 365.2425 days
So how bad is the Gregorian calendar?
365.2425 - 365.24219 = 0.00031 days
0.00031 * 24 * 60 * 60 = 26.784 seconds
We'll be 1 day out after 3236 years.  I'd guess they'll just change the leap years to fix the issue - though imagine the computer problems that will cause...  Note that leap seconds are designed to fix slight fluctuations in the rotation of the earth, correcting the duration of the day - they're nothing to do with calendars.

Conversion from Julian to Gregorian calendar

At the time when the Gregorian calendar was developed, there was a 10 day discrepancy with the Julian calendar.

In order to switch to the new calendar, those 10 days were simply dropped from October 1582.  Note this only affected the day numbers, not the day of the week.  Thursday 4th of October was simply followed by Friday 15th October.
European calendar for October 1582 showing skipped dates
Visual example of the official date change from Julian to Gregorian calendar.
It wasn't quite that simple though.  Only a few countries in Europe switched on 1582.  Many countries delayed adoption of the Gregorian calendar for hundreds of years.  In fact the last country to switch was Turkey in December 1926, and by that time 13 days had to be skipped.

England, and British Colonies switched in 1752.  You can observe this yourself using the Unix calendar utility.
Unix cal command showing September 1752 calendar
Unix cal (calendar) command showing the September 1752 calendar.

Computer handling of dates and times

I imagine it would have caused significant confusion and distress changing the calendars like this.  Firstly, just imagine if they had skipped your birthday.  More significantly though there would have to be complex rulings around rent, tax, the settlement of property and many other things.

Thank goodness they didn't have computers back then...  Surprisingly, many people still believe that Y2K was a beat-up.  Apart from the problem with many systems representing a date as two digits, there were also systems which did not correctly implement the Gregorian calendar rule for leap years in year 2000.

I'll leave you with this video, which really puts it into perspective the kind of problems software developers have to deal with when it comes to dates, times and timezones.


Popular posts from this blog

Resolving FOSCAM connection dropouts

Building an automatic chicken door opener

Installing Adobe Acrobat Pro 8 on Windows 7 x64