| home | contents | send comment | send link | add bookmark |

Perpetual Gregorian Calendar

by Stephen R. Schmitt


Sun Mon Tue Wed Thu Fri Sat

Contents

  1. About
  2. Source code
  3. Discussion

About

This JavaScript program calculates the days of the month for a given month and year. It was adapted from a BASIC program from the Astronomical Computing column of Sky & Telescope, July 1985.

The calculator will initialize itself, if possible, to your computer's month and year. The month and year can be changed using the buttons on the calculator. To advance the month or year press one of the [ >> ] keys; to backup, press one of the [ << ] keys.

Contents


Source Code

The Java Script source code for this program can be viewed by using the View|Source command of your web browser.

You may use or modify this source code in any way you find useful, provided that you agree that the author has no warranty, obligations or liability. You must determine the suitablility of this source code for your use.

Contents


Discussion

The Gregorian calendar that is in common use today was instituted by Pope Gregory in 1582 AD because the Julian calendar, in use since 45 BC, introduced an error of one day in every 128 years that had moved the date of the vernal equinox to March 11.

In the Julian calendar a common year contained 365 days. A year was a leap year of 366 days if it was exactly divisible by 4. This is true in the Gregorian calendar except that century years that are not divisible by 400 are common years; that is, 1900 and 2100 are not leap years while 2000 is a leap year.

The new calendar restored the vernal equinox to March 21. The numerical algorithm of the Gregorian calendar was devised by the Neapolitan astronomer-physician Aloysius Lilius (Luigi Lilio Ghiraldi). It took effect in Europe's Roman Catholic countries in October of 1582; October 4, 1582 was followed by October 15, 1582. Protestant countries continued to use the Julian calendar until the 1700's or later.

Contents


AbCd Classics - free on-line books


Copyright © 2004, Stephen R. Schmitt