Class ZmanimCalendar

All Implemented Interfaces:
Direct Known Subclasses:

The ZmanimCalendar is a specialized calendar that can calculate sunrise, sunset and Jewish zmanim (religious times) for prayers and other Jewish religious duties. This class contains the main functionality of the Zmanim library. For a much more extensive list of zmanim, use the ComplexZmanimCalendar that extends this class. See documentation for the ComplexZmanimCalendar and AstronomicalCalendar for simple examples on using the API. Elevation based zmanim (even sunrise and sunset) should not be used lekula without the guidance of a posek. According to Rabbi Dovid Yehudah Bursztyn in his Zmanim Kehilchasam, 7th edition chapter 2, section 7 (pages 181-182) and section 9 (pages 186-187), no zmanim besides sunrise and sunset should use elevation. However, Rabbi Yechiel Avrahom Zilber in the Birur Halacha Vol. 6 Ch. 58 Pages 34 and 42 is of the opinion that elevation should be accounted for in zmanim calculations. Related to this, Rabbi Yaakov Karp in Shimush Zekeinim, Ch. 1, page 17 states that obstructing horizons should be factored into zmanim calculations. The setting defaults to false (elevation will not be used for zmanim calculations besides sunrise and sunset), unless the setting is changed to true in setUseElevation(boolean). This will impact sunrise and sunset-based zmanim such as AstronomicalCalendar.getSunrise(), AstronomicalCalendar.getSunset(), getSofZmanShmaGRA(), alos-based zmanim such as getSofZmanShmaMGA() that are based on a fixed offset of sunrise or sunset and zmanim based on a percentage of the day such as ComplexZmanimCalendar.getSofZmanShmaMGA90MinutesZmanis() that are based on sunrise and sunset. Even when set to true it will not impact zmanim that are a degree-based offset of sunrise and sunset, such as ComplexZmanimCalendar.getSofZmanShmaMGA16Point1Degrees() or ComplexZmanimCalendar.getSofZmanShmaBaalHatanya() since these zmanim are not linked to sunrise or sunset times (the calculations are based on the astronomical definition of sunrise and sunset calculated in a vacuum with the solar radius above the horizon), and are therefore not impacted by the use of elevation. For additional information on the halachic impact of elevation on zmanim see:

Note: It is important to read the technical notes on top of the AstronomicalCalculator documentation before using this code.

I would like to thank Rabbi Yaakov Shakow, the author of Luach Ikvei Hayom who spent a considerable amount of time reviewing, correcting and making suggestions on the documentation in this library.


I did my best to get accurate results, but please double-check before relying on these zmanim for halacha lema'aseh.
© Eliyahu Hershfeld 2004 - 2023