"Calendrical Calculations" by Nachum Dershowitz and Edward M. Reingold.
ISBN 0-521-56413-1 hardback and ISBN 0-521-56474-3 softback. Also see http://emr.cs.uiuc.edu/home/reingold/calendar-book/index.html
This book explains how to convert between over a dozen calendars. More importantly, it describes the principles of calendar conversion. But it also has algorithms for everything, including finding holidays and leap years.
The book is elegant and authoritative. Anybody who wants to make a solid implementation of dates should study it.
My favorite quote is on page 28. To appreciate the quote, you should realize that the algorithms are presented in a condensed mathematical style which (I find) is readable and precise. However, it isn't executable. The authors are both theoreticians, so it is not surprising that they chose this style. The appendix has Common Lisp for the code.
''The functions given in the text are mechanically derived from the working Lisp code in Appendix B. In case of any ambiguity in the functions or discrepancy between the functions and the code, the code should be considered authoritative.''
This book is certainly authoritative. It should be consulted *instead* of the primary sources, as the authors have taken the time to reconcile and correct the various versions of calendars out there.
-- EricUlevik
Interesting: they want to *patent* the math, but all but two of their calendars are directly derived from the GNU EMACS project materials.
Is there an alternative work that eschews the oppressive licensing model?
Which GNU Emacs project materials? Random elisp files or what?
See also: DateAndTime