9

Date Algorithms

 3 years ago
source link: http://mysite.verizon.net/aesir_research/date/date0.htm
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Date Algorithms

Date Algorithms

By Peter Baum
Onset, MA 02558-1255
©1998, Peter Baum

Version: 1.003
Last Modified: August 5, 1998

The information contained in the sections listed below is a guide to computer programmers interested in implementing date algorithms in a variety of languages and on a wide range of hardware platforms. Although all rights are reserved under the copyright laws, programmers may implement the algorithms without permission. However, I would ask that if this is done for any of the algorithms that are not known to be fully documented elsewhere, a reference be made to this document. Doing so will assure full and consistent documentation, minimize the propagation of any errors that might be discovered, and provide a central location for any improvements that are made in the future.

Various calendar dates (Julian, Gregorian, and Rata Die) are used and produced by the algorithms that are presented but no attempt has been made to account for various problems associated with the general use of historical dates. For example, 90 days were inserted into the calendar by Julius Caesar in -45 and following Caesar's death, the leap year rule was misapplied until corrected by Emperor Augustus who omitted leap years from years -8 through +4. Various locations used different calendars throughout the Middle Ages and even within one locality, different calendars were often used for dating ecclesiastical records, fiscal transactions, and personal correspondence. None of these complications are accounted for by these algorithms. The following is assumed:

  • The year before the year 1 is 0 and the year before 0 is -1, et cetera. The year 0 corresponds to 1 B.C.
  • Julian dates may be applied both before the calendar was invented and after it was replaced as long as it is clear that the Julian leap year rules are being applied, usually by calling the date a Julian date.
  • Gregorian dates may be applied before the Gregorian calendar was invented as long as it is clear that the Gregorian calendar leap year rules are being applied, usually by calling it a Gregorian date.

AESIR RESEARCH HOME PAGE


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK