Please see the more recent and updated article Baal Hatanya’s Zmanim Added to KosherJava Zmanim Library for more current information.
Question:
How do I calculate the בעל התניא Baal Hatanya’s Zman for Shkiah as 4 minutes after sunset using the KosherJava Zmanim API?
Answer:
I was recently asked how to use the Zmanim API to calculate the Baal Hatanya’s opinion is that shkiah (halachic sunset) is 4 minutes after civil sunset. The assumption that the Baal Hatanya’s shkiah is a fixed 4 minutes after sunset is not that simple and will require a separate post to clarify. This zman should not be used lehalacha without consulting a rov. This post shows how to us the API assuming that it is a fixed 4 minutes after sunset. The technique to calculate this with the API is identical to the way getTzais72() would be calculated. The source of that method is
public Date getTzais72() { return getTimeOffset(getSeaLevelSunset(), 72 * MINUTE_MILLIS); }
The getTimeOffset(Date time, double offset) method in the base class AstronomicalCalendar is very simple:
public Date getTimeOffset(Date time, long offset) { if (time == null || offset == Long.MIN_VALUE) { return null; } return new Date(time.getTime() + offset); }
The getTimeOffset method simply adds the number of milliseconds of the offset to the raw time of the zman and returns it as a date. While using the API itself is not needed for such a simple calculation, here is how it would be used:
String locationName = "Jerusalem"; double latitude = 31.778; // Har habayis double longitude = 35.2354;// Har Habayis double elevation = 0; TimeZone timeZone = TimeZone.getTimeZone("Asia/Jerusalem"); GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone); ZmanimCalendar zc = new ZmanimCalendar(location); Date baalHatanyaShkiah = zc.getTimeOffset(zc.getSeaLevelSunset(), 4 * 60000); System.out.println("Baal Hatanya Shkiah: " + baalHatanyaShkiah);
Adding it to the API itself would be even simpler:
public Date getShkiahBaalHatanya() { return getTimeOffset(getSeaLevelSunset(), 4 * MINUTE_MILLIS); }
At some point in the future I may (doubtful) add this time to the API itself. The zman is not commonly used, and the Chabad calendars that I have seen all use regular sunset.
Update on July 5, 2015 – י״ח תמוז תשע״ה: This article was updated to clarify that the Baal Hatanya’s opinion may not be a fixed 4 minutes, but that the post was showing how to use the API to calculate it based on the questioner’s assumption that it was a 4 minute zman.
Update on Dec 14, 2018 – ו׳ טבת תשע״ט: This article was superseded with the more recent and corrected article Baal Hatanya’s Zmanim Added to KosherJava Zmanim Library.
I am apologize for the unrelated question, but…
I used once the zmanim framework on .net project… but now i need this only for html website. How can i use JAR files on html? or there is way to convert the JAR file to JS file?
I “googled” it, but didn’t found good answer.
Thanks
Oshri,
I know of no way to do this. Most of the API can be easily converted (manually) to a JavaScript API, but you will run into issues with timezone support even if you did accomplish it.
You are stating that the Alter Rebbe’s (baal hatanya) shkia is four minutes after shkia. that is not so simple, most chabad rabonim translate that into degrees with the four minutes being only in in Eretz Yisroel in Nissan and Tisheri. Any way you interpret the zman it will impact sof zman krias shma and tefilla making it earlier by a few minuts and plag later by a few minutes the reason this shkia is not shown in chabad calendars is twofold a) the gra’s zman is readily available and very close to the Alter Rebbe’s zman and the calendar printers used what they had. b) for Licht Bentchen and melacha on Friday the Alter Rebbe’s says to use the “regular” shkia, two shkia’s on a calendar would be quite confusing.
Menachem,
Thank you for contacting me. I should have been clearer with my post, as you are the second person to comment on this (the first was via email). I was asked by a software developer who uses the API how to use the API to add 4 minutes to sunset so that he can display the 4 minute Ba’al Hatanya’s zman. I do not know how the developer used it, and this does not impact any other zmanim in the API unless the developer explicitly used this shkiah to calculate the other zmanim. I will try to update the post for clarity later today.
There is another issue. Rav Yaakov Sh”Y Singavy, a magid shiur in Kiryat Gat, writes convincingly that the Alter Rebbe’s 4 min is 4 min, but that shkiah haniris (“regular” shkiah) is actually different than calendar time (because most calendars calculate that shkiah from sea level, when this should not be the case according to the Alter Rebbe). This obviously complicates the matter. In any case, shkia amitis shouldn’t be publicized because it can lead to chilul Shabbos and aside from the obligation of tosefes Shabbos there’s a chiyuv in any case to accept Shabbos once every Kehila has. The problem is more in terms of calculating tzeis according to this.