"Bryan A. Bentz" <be...@ai.mit.edu> writes:
> I'm looking for some uniform mechanism to represent chronological
> dates, including BC, potentially different calendars, etc. What I want
> to do is to be able to enter events in these different systems, and
> reconcile them on to one calendar (time line), in one system (that is,
> I don't need something which will convert any date in any system to any
> other system).
> Before I write such a beast, might anyone out there have one? I'd
> appreciate a direct reply, as my news server is really flaky.
> Bryan Bentz
Bryan, you certainly should not re-invent this wheel.
There was a paper in `Software -- Practice and Experience' a few years
ago. The authors discussed the problem at length and used Scheme code
as an expository vehicle. I know I have seen the code translated into
Common Lisp too.
A quick AltaVista search gives:
http://emr.cs.uiuc.edu:80/~reingold/calendars.html
________________________________________________________________________
Edward M. Reingold's Calendar Book, Papers, and Code
Calendrical Calculations
By Nachum Dershowitz and Edward M. Reingold.
Cambridge University Press, 1997.
A unified, algorithmic presentation is given for the Gregorian (current civil), ISO, Julian
(old civil), Islamic (Moslem), Hebrew (Jewish), Persian, Coptic, Ethiopic, Bahai, Mayan,
French Revolutionary, Chinese, and Hindu calendars. Easy conversion among these
calendars is a byproduct of the approach, as is the determination of secular and religious
holidays. Calculations of lunar phases, solstices, equinoxes, sunrise, and sunset are
described as well.
The following material is now way out of date, having been superceded by the book above.
Calendrical Calculations
By Nachum Dershowitz and Edward M. Reingold.
Software-Practice and Experience 20 (1990), 899-928.
A unified, algorithmic presentation is given for the Gregorian (current civil), ISO, Julian
(old civil), Islamic (Moslem), and Hebrew (Jewish) calendars. Easy conversion among
these calendars is a byproduct of the approach, as is the determination of secular and
religious holidays. (PostScript; 30 pages)
Calendrical Calculations, II: Three Historical Calendars
By Edward M. Reingold, Nachum Dershowitz, and Stewart M. Clamen.
Software-Practice and Experience 23 (1993), 383-404.
Algorithmic presentations are given for three calendars of historical interest, the Mayan,
French Revolutionary, and Old Hindu. (PostScript; 22 pages)
Common Lisp code from above calendar papers
C++ code for most of the Lisp code in the first paper
The GNU Emacs Implementation of the Calendar