An implementation of Professor John H. Conway's Hebrew Calendar algorithm.
I've tested this implementation for accuracy using dates from 1 CE - 3000 CE by comparing to the Hebrew calendar behind http://www.hebcal.com/. Note that:
- Results prior to the adoption of the Gregorian calendar (~1752, depending on location) use the proleptic Gregorian calendar. This implementation is in Golang, and my understanding of Go's time.Time is that it similarly uses a proleptic Gregorian calendar.
- Some time between 70 and 1178 CE, the observation-based Hebrew calendar was replaced by the calculated calendar developed by Hillel HaNasi. So this implementation projects a proleptic calculated Hillel Hebrew calendar (a term that I just made up) onto a proleptic Gregorian calendar.
Professor Conway was able to convert between Hebrew and Gregorian calendar dates by way of mental math in seconds. After his death, I learned that a paper explaining his algorthim had been published in the January 2014 edition of The College Mathematics Journal. (For archival purposes, I've copied the PDF here.)
This repo implements Conway's Hebrew Calendar algorithm in Go.
Along the implementation path, I found a few notable items that are not explained in the paper.
- On p. 3, when calculating the date of Rosh Hashannah, truncate, don't round. This seems to contradict the paper which states that Sept 29.5 --> Sept 30, but author David Slusky told me to truncate and empirical evidence is that truncating works.
- On p. 3, when calculating
SHE
, use4
in the tens digit if the outgoing year was a leap year.