
Calendrical Calculations
by Edward M Reingold · first published 2018
53% recommend47% neutral
Why HN recommends it
Covers many world and historical calendar systems and how to convert between them, with computational methods and Lisp code; recommended for programmers who need calendar logic or want a deep, detailed treatment.
Summarised by Claude from recommending comments
"A valuable resource for working programmers, as well as a fount of useful algorithmic tools for computer scientists, this new edition of the popular calendars book expands the treatment of the previous edition to new calendar variants: generic cyclical calendars and astronomical lunar calendars as well as the Korean, Vietnamese, Aztec, and Tibetan calendars. The authors frame the calendars of the world in a completely algorithmic form, allowing easy conversion among these calendars and the determination of secular and religious holidays. LISP and Java code for all the algorithms are available
Affiliate links. As an Amazon Associate I earn from qualifying purchases.


At a more coarse-grained level, "Calendrical Calculations" by Dershowitz and Reingold is very interesting. It describes many different world and historical calendar systems, and includes lisp code to convert between them. Among many other problems, converting…
on “Some Notes About Time” ↗Calendar time, when it is done truly right, is a complicated topic. There's a nice book that has way more detail on this than most people actually would want (Calendrical Calculations, https://www.amazon.com/Calendrical-Calculations-Nachum-Dersh...).
on “What Time Is It?” ↗"Easter is a feast, not a planet." --Johannes Kepler A good reference for anyone who has to write calendar related code is the book "Calendrical Calculations" by Dershowitz and Reingold [1]. [1] https://www.amazon.com/Calendrical-Calculations-Nachum-Dersh...
on “The Patek Philippe Caliber 89 and Horology’s Easter Problem” ↗I highly recommend reading Calendrical Calculations, a book by Edward Reingold and Nachum Dershowitz. It is a beautiful combination of computer science and calendar systems. Also, the Hebrew calendar truly is a marvel, as the book goes through.
on “Jewish Calendar Demystified (2007)” ↗In a similar vein, Calendrical Calculations by Reingold and Dershowitz.
on “Ask HN: What piece of code/codebase blew your mind when you saw it?” ↗…card catalog. This is what I miss about technical bookstores. Serendipity. And computers can't yet duplicate that, since what is serendipitous often has nothing to do with me until I find it. I found Calendrical Calculations on the shelf at SoftPro books in Centennial, while just generally browsing. I have never before, and never since, bought a book about calendar systems. What I like most about it was the historical treatment…
on “The Books of College Libraries Are Turning into Wallpaper” ↗What is a day, when does it start and end, etc, have various definitions around the world and in history. https://books.google.com/books/about/Calendrical_Calculation... Calendrical Calculations is a fascinating intro the different calendar systems, along with computational methods of converting between systems.
on “Saudi Arabia adopts the Gregorian calendar” ↗…have IMO been clearer, and so much use of raw car/cdr/caadr/caddr/whatdr instead of more clearly structured structs or classes or just helper functions called intuitive things like get-foo. (The book Calendrical Calculations: The Ultimate Edition uses lists for all its data structures but helpfully creates many functions to both construct and access their parts. e.g. generic dates are a (year month day) list, but the definition…
on “Typed Lisp, a Primer” ↗…kept and obtained a number of other books simply because they are antiquated, special and/or classics that are interesting to read even if they are not that useful to me, like Codd's relational book, or Calendrical Calculations. I hope the AI is trained on these sorts of books, so that the knowledge can live on in a different way.
on “Nobody cracks open a programming book anymore” ↗…don't worry about others' opinions and don't think that your solution applies generally to most other use cases. Also, among the many resources for general and specific solutions to time problems is "Calendrical Calculations," by Dershowitz and Reingold. I found it randomly, bought it on a lark, and hope to $DEITY I never haver to care about time for anything critical. http://www.worldcat.org/search?qt=worldcat_org_all&q=calendr...
on “The need for timezone awareness” ↗…years and everything works fine. Primitives such as "nextNewMoon" etc can either be coded in LUA as part of initialisation, or added to the internal LUA run-time. The calendar algorithms are all from "Calendrical Calculations" by Nachum-Dershowitz. Although i converted them to C++ (from lisp!). At some point i need to finished the Chinese calendar :-)
on “The deceptively complex world of RRULEs” ↗…https://en.wikipedia.org/wiki/International_Earth_Rotation_a... [2] For example, https://en.wikipedia.org/wiki/Swedish_calendar [3] https://en.wikipedia.org/wiki/Easter#Computations [4] https://www.amazon.com/Calendrical-Calculations-Nachum-Dersh...
on “Working with time in Postgres” ↗I think every language I've used has annoyed me in how it handles dates and times. I've been tempted several times to sit down and repeatedly read Dershowitz and Reingold's book "Calendrical Calculations" [1] cover to cover until I thoroughly understand it, and then write my own date and time library and port it to every language I use. That would mean that when I learn a new language I'd have to take…
on “To Ruby from Python” ↗…people developing time and date libraries for other languages and systems: http://naggum.no/lugm-time.html The premiere text on time and date algorithms IS written in Common Lisp: http://www.amazon.com/Calendrical-Calculations-Millennium-Ed... And here is a taste of what's out there; http://www.cliki.net/TIMER http://www.cliki.net/net-telent-date http://www.cliki.net/local-time http://www.cliki.net/Date-Calc http://www.cliki.net/cl-l10n
on “A natural language date and time parser for Common Lisp” ↗Dershowitz & Reingold's "Calendrical Calculations" touches on this. The book goes describes how to represent calendars, and how to convert between them (Gregorian, Julian, Ethiopian, Islamic, Hebrew, Hindu, Mayan, and French Revolution, among others).…
on “The Ten Days that Disappeared” ↗