# Baal Hatanya’s Zmanim Added to KosherJava Zmanim Library

While most calendars list the גר״א Gra and בעל התניא Baal Hatanya zmanim as identical, things are not that simple. Both are based on a day being from sunrise to sunset, but recently some Chabad calendars started using slightly different calculations for the Baal Hatanya’s zmanim. It should be noted that these zmanim are not universally accepted in Chabad (see the Opposing View section below). According to the Baal Hatanya in the סדר הכנסת שבת Seder Hachnasas Shabbos,

zmanim are calculated based on a 4 minute delay in shkiah. These 4 minutes are calculated as the sun’s position in degrees before sunrise and after sunset. While Chabad considers netz (also known as hanetz) as standard sunrise and shkiah as standard sunset, this is lechumra, and other zmanim are based on a slightly earlier sunrise and a slightly later sunset.

About 3 1/2 years ago, I posted information on calculating the Baal Hatanya’s Shkiah. That article was focused on a software developer’s perspective and explained how to use the existing API to calculate a fixed clock 4 minute zman that was not natively supported by the KosherJava zmanim library. Recently Yechiel Paricher contributed code to the KosherJava zmanim API/Library that added native support for various Baal Hatanya zmanim. This will enable users of the Zmanim library to easily include Baal Hatanya zmanim in their software.

According to the Baal Hatanya, shkiah amitis (true halachic sunset) is defined as:

כי אחר סילוק וביאת האור מראשי האילנות וגגים הגבוהים בכמו ד׳ חלקי ששיים משעה (שקורין מינוטין) אזי היא שקיעה האמיתית, שהוא סילוק וביאת האור מראשי ההרים הגבוהים שבארץ ישראל.

The time is calculated as the point at which the center of the sun’s disk is 1.583° below the horizon. Chabad applies the same degree based offset to netz amiti (true halachic sunrise). This degree based calculation can be found in Rabbi Shalom DovBer Levine’s commentary on The Baal Hatanya’s Seder Hachnasas Shabbos. From an elevation of 546 meters at the top of Har Hacarmel (based on the Gemara Shabbos 35a), the sun disappears at sunset when it is 1.583° (1° 35′) below the sea level horizon. There are other opinions that are not included in the code (but can easily be calculated using the API). One such example is a very similar (degree-wise) netz amiti from Rabbi Yosef Yitzchok Feigelstock. Rabbi Feigelstock calculates shkiah amitis as the degrees below the horizon 4 minutes after sunset in Yerushalaym (on the equinox). That degree based zman is listed in his letter to Rabbi Levine published in the back of the Seder Hachnasas Shabbos as 1.583°. The 1.583° is a typo (confirmed by Rabbi Feigelstock since it is identical to the 1° 35′ zman) and should be 1.683°. The calculations added to the KosherJava Zmanim library are used by most Chabad calendars that follow the Baal Hatanya’s Zmanim. See About Our Zmanim Calculations @ Chabad.org.

Zmanim based on shaos zmaniyos are based on a day between netz amiti and shkiah amitis calculated as 1.583° below the horizon. The various Baal Hatanya zmanim now part of the zmanim library include:

• Alos 16.9° – based on the sun’s position below the horizon 72 minutes before netz amiti in Yerushayim around the equinox.
• Sunrise or netz amiti – calculated as 1.583° below the horizon. This method is private and is only used as a base for other calculations.
• Sof Zman Shma – calculated as 3 shaos zmaniyos (or a 1/4 of the day) after netz amiti.
• Sof Zman Tfila – calculated as 4 shaos zmaniyos (or a 1/3 of the day) after netz amiti.
• Sof Zman Achilas Chametz – calculated as 4 shaos zmaniyos (or a 1/3 of the day) after netz amiti.
• Sof Zman Biur Chametz – calculated as 5 shaos zmaniyos after netz amiti.
• Mincha Gedola – calculated as 6.5 shaos zmaniyos after netz amiti.
• Mincha Gedola – Greater Than 30 – As above, but with a minimum 30 clock minutes after chatzos.
• Mincha Ketana – calculated as 9.5 shaos zmaniyos after netz amiti.
• Plag Hamincha – calculated as 10.75 shaos zmaniyos after netz amiti.
• Sunset or shkiah amitis – calculated as 1.583° below the horizon. This method is private and is only used as a base for other calculations.
• Tzais – calculated as the time when the sun is 6° below the western horizon. Note that as per Rabbi Yosef Yitzchok Feigelstock, for Motzai Shabbos, Motzai Yom Kippur and Motzai Yom Tov, the 8.5° time should be used. The time between 6° and 8.5° is part of tosfos Shabbos and tosfos Yom Kippur. Other zmanim such as zman krias shema can use the 6° zman. The 8.5° zman has always been part of the API, and sample code for calculating tzais 8.5° can be seen below.

These zmanim (not my implementation) that Chabad.org spent 2 years researching, have a haskama (endorsement) from Chabad Dayanim. Chabad.org zmanim do not provide seconds (appropriate due to expected refraction variances), but with the rounding rules provided by Rabbi Mordechai Sandhaus, the lead developer at Chabad.org, I was able to confirm that the Baal Hatanya zmanim generated by the KosherJava zmanim library match the Chabad.org times.

Please note that there are various Chabad shittos for netz, shkiah and tzais zmanim. The above are the commonly used ones. Other opinions on Baal Hatanya based zmanim that are less commonly used are not included in the API, but given the flexibility of the KosherJava Zmanim API they can easily be calculated.These include:

• Netz Amiti 1.683° as calculated by Rabbi Feigelstock and mentioned above (only used for calculating other zmanim).
• Shkiah Amitis 1.683° as calculated by Rabbi Feigelstock and mentioned above (only used for calculating other zmanim).
• Tzais 5.833° as calculated by Rabbi Shalom DovBer Levine lekula for derabanans.
• Tzais 6.3° as calculated by Rabbi Avrohom Altein, Chabad of Winnipeg, Manitoba, Canada.
• Tzais 6.833° as calculated by Rabbi Shalom DovBer Levine lechumra for deoraysas.
• Tzais 8.5° as commonly used by Chabad lechumra and mentioned above.

Code samples for these zmanim can be seen below.

## Opposing Views

The relatively new calculations of zmanim based on netz amiti and shkiah amitis are not universally accepted in Chabad. Rabbi Avrohom Altein, the Rov of Chabad of Winnipeg, Manitoba, mentioned in a correspondence, that it is difficult to accept these new zmanim calculations as is.

The Alter Rebbe only speaks explicitly of shkiya amitis in regards to the beginning of Shabbos. We can draw comparisons to other areas of halacha but those comparisons needs to be carefully evaluated.
I believe that the Alter Rebbe does not calculate shaos zmaniyos based on netz & shkiya amitis, but rather on the standard netz & shkiya. There are several strong proofs to this. In earlier years, all of Chabad calculated shaos zmaniyos for laws of chometz, reading Shema etc., on the basis of standard sunrise and sunset and I believe that’s how the older Colel Chabad Luchos did the calculation. In recent years, this has changed in the Colel Chabad Luchos and chabad.org based on the opinion of Rabbi SDB Levin and Rabbi Feigeslstock — but there are Chabad rabbis that do not agree with their interpretation.

## Code Samples

For developers, here is sample code that calculates the new zmanim. This should allow many zmanim apps to add Baal Hatanya zmanim with very little effort.

```String locationName = "770 Eastern Parkway";
double latitude = 40.669;
double longitude = -73.943;
double elevation = 30;
TimeZone timeZone = TimeZone.getTimeZone("America/New_York");
GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone);
ComplexZmanimCalendar czc = new ComplexZmanimCalendar(location);
czc.getCalendar().set(1994, Calendar.JUNE, 12);
System.out.println("Alos: " + czc.getAlosBaalHatanya()); //16.9 degrees
System.out.println("Sunrise: " + czc.getSunrise()); //standard sunrise
System.out.println("Sof Zman Shma: " + czc.getSofZmanShmaBaalHatanya());
System.out.println("Sof Zman Tfila: " + czc.getSofZmanTfilaBaalHatanya());
System.out.println("Sof Zman Achilas Chametz: " + czc.getSofZmanAchilasChametzBaalHatanya()); //only use on Erev Pesach
System.out.println("Sof Zman Biur Chametz: " + czc.getSofZmanBiurChametzBaalHatanya()); //only use on Erev Pesach
System.out.println("Mincha Gedola: " + czc.getMinchaGedolaBaalHatanya());
System.out.println("Mincha Gedola Min 30: " + czc.getMinchaGedolaBaalHatanyaGreaterThan30());
System.out.println("Mincha Ketana: " + czc.getMinchaKetanaBaalHatanya());
System.out.println("Plag Hamincha: " + czc.getPlagHaminchaBaalHatanya());
System.out.println("Sunset: " + czc.getSunset()); //standard sunset
System.out.println("Tzais Baal Hatanya: " + czc.getTzaisBaalHatanya()); //6° degrees
System.out.println("Tzais 8.5°: " + czc.getTzaisGeonim8Point5Degrees()); //8.5° degrees lechumra commonly used by Chabad
System.out.println("Shaah Zmanis Baal Hatanya: " + czc.getShaahZmanisBaalHatanya());
```

Calculating other Baal Hatanya based zmanim not included in the library are very simple. Here are a few examples

```System.out.println("Netz Amiti 1.683°: " + czc.getSunriseOffsetByDegrees(90 + 1.683)); //Rabbi Feigelstock netz amiti (only used for calculating other zmanim)
System.out.println("Shkiah Amitis 1.683°: " + czc.getSunsetOffsetByDegrees(90 + 1.683)); //Rabbi Feigelstock shkiah amitis (only used for calculating other zmanim)
System.out.println("Tzais 5.833°: " + czc.getSunsetOffsetByDegrees(90 + 5.833)); //Rabbi Levine lekula for derabanans
System.out.println("Tzais 6.3°: " + czc.getSunsetOffsetByDegrees(90 + 6.3)); //Rabbi Avrohom Altein
System.out.println("Tzais 6.833°: " + czc.getSunsetOffsetByDegrees(90 + 6.833)); //Rabbi Levine lechumra for deoraysas
```

I would like to thank Rabbi Yosef Yitzchok Feigelstock, the Rov of Chabad in Buenos Aires, Rabbi Avrohom Altein, the Rov of Chabad in Winnipeg and Rabbi Mordechai Sandhaus, the lead developer at Chabad.org for reviewing this post.

## 9 thoughts on “Baal Hatanya’s Zmanim Added to KosherJava Zmanim Library”

1. misha beshkin says:

Exactly what I need for a current project. Could you please share compiled jar?

1. Misha,
Great to hear that it is useful. What JDK version do you need it compiled against? my current dev machine only has JDK 10 and 11 installed.

2. Danny says:

HI

looking for Util that will tell me if current time on my location is Saterday/Holidat
where output is true/false

does such method exist?

3. E. Poultorak says:

Hi KosherJava,
What are the degrees constants based on? (8.5, 3.65…)
I tried to calculate them on Har Habayis at equinox times, and they didn’t match any of the number of minutes that I expected (13.5, 36…)
Thank you

1. E. Poultorak,
There are a few things to keep in mind that are mentioned in the developer documentation.
One relates to GEOMETRIC_ZENITH that has confused many developers. With sunrise and sunset the solar radius and refraction are added to the 90° for a total of 90.833°, while other dips such as 16.1° that corresponds to Rabbeinu Tam 72 minutes traditionally are calculated without this. It really boils down to the same thing. Calculate it at 16.1° without refraction or subtract 0.833° and call it something else. Ultimately it is the sun’s position 72 minutes before sunrise on the halachic equinox.
The second item to know is that it is not calculated on the equinox, but 4 days before as clarified in the documentation of ZENITH_8_POINT_5 (I have to make this clear on the documentation in other parts of the code). Halachically the day starts when the upper limb of the sun becomes visible (hanetz) and ends when the upper limb of the sun disappears from view at sunset. On the astronomical equinox the calculations are based on the radius of the sun being above the horizon in a vacuum. When you calculate 72 minutes before sunrise it is visible sunrise. The API is flexible enough for you to use astronomical equinox if you want to calculate it that way (just use a different dip).
A third thing to note is that while 8.5° corresponds to 36 minutes and 3.8° corresponds to 13.5 minutes, some dips are based on measured light levels and do not have a known number of minutes (though of course there is one).
Please let me know if this clarified things.

1. E. Poultorak says:

I was taking refraction into account, but it still didn’t match. Now that you told me you used March 16, it makes more sense. I didn’t think the length of the solar day would be at its average 4 days before the equinox, instead of the equinox.

So you’re using Jerusalem as the reference point, which makes sense. But you also mention Har Hacarmel in this post. Is there a Mekor that discusses which one should be used?

Do you use Har Hacarmel in this example because of what the Baal Hatanyah said: ראשי ההרים הגבוהים שבארץ ישראל.
In that case, shouldn’t you use higher mountains?

From what I can understand in the Gemara Shabbos 35a, it’s saying it takes 9 minutes to go from the top of Har Hacarmel to the sea. However, if you take the highest point (546m elevation), it’s at least 7km away from the nearest point in the sea. It’s impossible to walk that far in 9 minutes. Could it be the Gemara is talking about the point at 32.82774, 34.96982? If you look at the terrain map on Google, it’s still part of Har Hacarmel, but it’s much lower and closer to the sea (about 400m in a straight line).

Thank you

1. The source for using Har Hacarmel is mentioned and linked above סדר הכנסת שבת Seder Hachnasas Shabbos. It for the most part is used by Chabad, and not others. See Rabbi Shalom DovBer Levine’s commentary on The Baal Hatanya’s Seder Hachnasas Shabbos, specifically comments 9 & 10 starting on page ה in the PDF above and letters from Rabbi Yehoram Ulman on page עה, Rabbi Yosef Yitzchok Feigelstock’s starting on page צג, and Rabbi Shalom DovBer Hertzel on page עז of the PDF. They talk about where on Har Hacarmel the calculations are based on, and why higher mountains (or why higher points on Har Hacarmel) are not used.

1. E. Poultorak says:

Great, thank you. I will have a look.