Wednesday, December 19, 2007

A Short History of the CalendarExcerpt from Joe Celko's Data and Databases: Concepts in Practice

The Western world is and has been on a solar calendar. That means a year is defined as one revolution of the earth around the sun. Unfortunately, this revolution is not an even number of days (one solar year = 365.2422 days) and therefore solar calendars drift out of alignment unless corrected.

The Egyptian calendar drifted completely around approximately every 1,461 years and made two complete cycles from its introduction to the time of Julius Caesar. As a result, this calendar was useless for agriculture. The Egyptians relied on the stars to predict the flooding of the Nile. Julius Caesar decreed that the year 708 AUC (ab urbis conditae from the founding of the city of Rome, or 46 BCE) had 445 days in order to realign the calendar with the seasons. Leap years were referred to as bissextile years.

Julius Caesar, on the advice of Sosigenes of Alexandria, also introduced leap years in 708 AUC (they did not exist in solar calendars prior to then). This calendar became known as the Julian calendar. The year 46 BCE was called the Year of Confusion by the Romans.

Over the next several centuries, months were added to the year, and days were added and subtracted from the months by assorted Romans, until the Christians had control over the calendar. The problem with the Julian calendar was that it used a simple four-year leap year cycle. It drifted by approximately 3 days every 400 years and had gotten 10 days out of step with the seasons by 1582.

However, you might want to remember that a Roman calendar without a leap year would have drifted ‘completely around’ slightly more than once between 708 AUC and 2335 AUC (1582 CE). The summer solstice, so important to planting crops, had no relationship to June 21 by 1582, so Pope Gregory took two weeks out of the month of October in 1582 to realign things. (A thousand years before Pope Gregory, the Aztecs and Mayans knew the number of days in a solar year to three decimal places.)

The Gregorian calendar is now properly known as the Common Era calendar to avoid religious references that might confuse non-Christians. What used to be AD and BC are now properly abbreviated as CE and BCE.

The transition from the old Julian calendar to the Gregorian calendar took place at different times in different countries:

# The Italian duchies and kingdoms, Catholic parts of Switzerland, Spain, and Portugal (at that time under the same king, Philip II), including their colonies, skipped from 1582 October 4 to 1582 October 15.

# France (including its colonies) skipped from 1582 December 9 to 1582 December 20.

# Poland skipped from 1582 October 4 to 1582 October 15.

# German-Roman Empire (the Habsburgs in Austria): in 1583.

# German duchies with Catholic confession: in 1583.

# German duchies with Protestant confession skipped from 1700 February 18 to 1700 March 1.

# Netherlands: in 1700.

# Protestant parts of Switzerland: in 1701.

# Denmark and Norway skipped from 1700 February 18 to 1700 March 1.

# Sweden and Finland skipped from 1753 February 17 to 1753 March 1, but were one day apart from the old calendar between 1700 and 1712! (that is, 1700 February 28 was followed by 1700 March 1, and 1712 February 29 was followed by 1712 February 30, which was followed by 1712 March 1).

# Great Britain and its colonies skipped from 1752 September 2 to 1752 September 14.

# Russia and the former Soviet Union skipped from 1918 January 18 to 1918 February 1 (therefore, the October Revolution took place 1917 November 7 in the Gregorian calendar).

# The Balkan nations switched between 1918 and 1924.

The Julian Date

If you’re going to use universal dates, think big and use Julian dates. The Julian date is a number set up by astronomers that currently is seven digits long. It ranges from 4713 January 01 BCE through 27,378 CE, which ought to be enough for any database application. The use of the starting date of 4713 January 01 BCE is related to solar and lunar cycles. This format avoids some problems, such as finding the day of the week (take the Julian date modulo 7) and leap year conversions. Durations are calculated by simple subtraction and addition. Finding the phase of the moon, lunar eclipses, solar eclipses, and other astronomical facts is fairly simple algebra which is why astronomers use it. The downside is that existing systems, both legal and computer, would need to be rewritten.