Class ComprehensiveZmanimCalendar

All Implemented Interfaces:
Cloneable

This class extends ZmanimCalendar and provides many more zmanim than available in the ZmanimCalendar. The basis for most zmanim in this class are from the sefer Yisroel Vehazmanim by Rabbi Yisrael Dovid Harfenes. As an example of the number of different zmanim made available by this class, there are methods to return 18 different calculations for alos (dawn), 18 for plag hamincha and 29 for tzais available in this API. The real power of this API is the ease in calculating zmanim that are not part of the library. The methods for zmanim calculations not present in this class or it's superclass ZmanimCalendar are contained in the AstronomicalCalendar, the base class of the calendars in our API since they are generic methods for calculating time based on degrees or time before or after sunrise and sunset and are of interest for calculation beyond zmanim calculations. Here are some examples.

First create the Calendar for the location you would like to calculate:

String locationName = "Lakewood, NJ";
double latitude = 40.0828; // Lakewood, NJ
double longitude = -74.222; // Lakewood, NJ
double elevation = 20; // optional elevation correction in Meters
// the String parameter in getZoneId() has to be a valid ZoneId listed in ZoneId.getAvailableZoneIds()
ZoneId zoneId = ZoneId.of("America/New_York");
GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, zoneId);
ComprehensiveZmanimCalendar czc = new ComprehensiveZmanimCalendar(location);
// Optionally set the date or it will default to today's date
ZonedDateTime dateTime = ZonedDateTime.of(1969, Month.FEBRUARY.getValue(), 8, 0, 0, 0, 0, location.getZoneId());
czc.setZonedDateTime(dateTime);

Note: For locations such as Israel where the beginning and end of daylight savings time can fluctuate from year to year, if your version of Java does not have an up to date time zone database, create a SimpleTimeZone with the known start and end of DST. To get alos calculated as 14° below the horizon (as calculated in the calendars published in Montreal), add AstronomicalCalendar.GEOMETRIC_ZENITH (90) to the 14° offset to get the desired time:

 Instant alos14 = czc.getSunriseOffsetByDegrees(AstronomicalCalendar.GEOMETRIC_ZENITH + 14);

To get mincha gedola calculated based on the Magen Avraham (MGA) using a shaah zmanis based on the day starting 16.1° below the horizon (and ending 16.1° after sunset) the following calculation can be used:

Instant minchaGedola = czc.getTimeOffset(czc.getAlos16point1Degrees(), czc.getShaahZmanis16Point1Degrees() * 6.5);

or even simpler using the included convenience methods

Instant minchaGedola = czc.getMinchaGedola(czc.getAlos16point1Degrees(), czc.getShaahZmanis16Point1Degrees());

A little more complex example would be calculating zmanim that rely on a shaah zmanis that is not present in this library. While a drop more complex, it is still rather easy. An example would be to calculate the Trumas Hadeshen's alos to tzais based plag hamincha as calculated in the Machzikei Hadass calendar in Manchester, England. A number of this calendar's zmanim are calculated based on a day starting at alos of 12° before sunrise and ending at tzais of 7.083° after sunset. Be aware that since the alos and tzais do not use identical degree-based offsets, this leads to chatzos being at a time other than the solar transit (solar midday). To calculate this zman, use the following steps. Note that plag hamincha is 10.75 hours after the start of the day, and the following steps are all that it takes.

Instant plag = czc.getPlagHamincha(czc.getSunriseOffsetByDegrees(AstronomicalCalendar.GEOMETRIC_ZENITH + 12),
                                czc.getSunsetOffsetByDegrees(AstronomicalCalendar.GEOMETRIC_ZENITH + ZENITH_7_POINT_083));

Something a drop more challenging, but still simple, would be calculating a zman using the same "complex" offset day used in the above-mentioned Manchester calendar, but for a shaos zmaniyos based zman not supported by this library, such as calculating the point that one should be makpid not to eat on erev Shabbos or erev Yom Tov. This is 9 shaos zmaniyos into the day.

  1. Calculate the shaah zmanis in milliseconds for this day
  2. Add 9 of these shaos zmaniyos to alos starting at 12°

long shaahZmanis = czc.getTemporalHour(czc.getSunriseOffsetByDegrees(AstronomicalCalendar.GEOMETRIC_ZENITH + 12),
                                                czc.getSunsetOffsetByDegrees(AstronomicalCalendar.GEOMETRIC_ZENITH + ZENITH_7_POINT_083));
Instant sofZmanAchila = getTimeOffset(czc.getSunriseOffsetByDegrees(AstronomicalCalendar.GEOMETRIC_ZENITH + 12),
                                        shaahZmanis * 9);

Calculating this sof zman achila according to the GRA is simplicity itself.

Instant sofZmanAchila = czc.getTimeOffset(czc.getSunrise(), czc.getShaahZmanisGRA() * 9);

See documentation from the ZmanimCalendar parent class

Author:
© Eliyahu Hershfeld 2004 - 2026