The Yereim’s Bein Hashmashos

Rabbi Eliezer of Metz (known by his acronym The רא״ם Re’em), a disciple of Rabbeinu Tam, in his Sefer Yereim ספר יראים chapter 274, states that bein hashmashos starts the time it takes to walk three quarters of a mil before sunset, and ends at sunset.

פירוש משתשקע החמה דר׳ יהודה ור׳ נחמיה משמתחלת לשקוע שנוטה מעט ומכירים העולם שרוצה להכנס בעובי הרקיע … ולשון משתשקע משמע הקדמה … וכן נראה לי עיקר דמשתשקע החמה הוא קודם שקיעת החמה דעולא ולא כדברי רבינו יעקב … ואין להקפיד על צאת הככבים … אע״ף שאין הכוכבים נראים … שלילה גמור הוא כפירושי.

The Yereim’s opinion is brought down by other Rishonim including the Mordechai and Rav Alexander Suslin HaKohen in his Sefer Agudah. The Yereim is mentioned by the Bach as a reason for the minhag of starting Shabbos early. The Yereim’s times are not brought down by the poskim lehalacha.

The Time to Walk a Mil

The time to walk a mil is based on the Gemara in Pesachim 93b – 94a. The time ranges in the poskim and includes 18, 22.5 and 24 minutes. Three quarters of these mil times would be 13.5, 16.875 and 18 minutes. It should be noted that the Yereim is of the opinion that a mil is 24 minutes. The above mentioned Mordechai who quoted the Yereim is also of the same opinion. We will hopefully discuss in detail the various opinions on the time to walk a mil in a future article.

The Addition of the Yereim’s Times to the KosherJava Zmanim Library

As of the 2.1.0 release of the KosherJava zmanim library, the Yereim’s bein hashmashos times have been added to the KosherJava zmanim library/API. There are six variants of these zmanim that were added. These include the three exact minute offsets mentioned above, as well as the conversion of these three times to degrees (elevation angle, or solar zenith angle). The only prior degree based time for the Yereim that I am aware of is in Rabbi Yedidya Manet’s Zmanei Halacha Lema’aseh (זמני ההלכה למעשה מהרב ידידיה מנת). The Zmanei Halacha Lema’aseh charts calculate bein hashmashos in degrees based on the 18 minute (3/4 of a 24 minute mil, see p. 27 in the 4th ed. published in 2005), but does not clarify the degrees used. At Rabbi Yaakov Shakow’s recommendation, I used the refraction value of 31/60 or 0.516° that exists in Israel, as opposed to the global average of 0.566°, a figure mentioned in the Zmanei Halacha Lema’aseh (p. 11). I also slightly rounded the times. These small tweaks resulted in a trivial maximum 19 second chumra vs the non-rounded global average refraction. The resulting degrees of elevation angle for the Yereim’s bein hashmashos are 2.1°, 2.8° and 3.05°. Solar zenith angles are traditionally calculated using the sun’s position without adjusting for refraction and without accounting for the solar radius (i.e. it is the position of the center of the sun in a vacuum). This does not impact the calculated time, it is simply the convention used.
A future article will address the proper date to use for converting minute based times to degrees below (or above) the horizon and show how to use the KosherJava Zmanim code to calculate this.
I would like to thank Rabbi Yaakov Shakow for his help and suggestions.

Sample Code

Below are code examples for all six variants of the Yereim’s Bein Hashmashos (spelled BainHashmashos in the code).

GeoLocation yerushalayim = new GeoLocation("Jerusalem, Israel", 31.778, 35.2354, 0, TimeZone.getTimeZone("Asia/Jerusalem"));
ComplexZmanimCalendar czc = new ComplexZmanimCalendar(yerushalayim);
Date bh18Min = czc.getBainHasmashosYereim18Minutes();
Date bh3Pt05Deg = czc.getBainHasmashosYereim3Point05Degrees();
Date bh16Pt875Min = czc.getBainHasmashosYereim16Point875Minutes();
Date bh2Pt8Deg = czc.getBainHasmashosYereim2Point8Degrees();
Date bh13Pt5Min = czc.getBainHasmashosYereim13Point5Minutes();
Date bh2Pt1Deg = czc.getBainHasmashosYereim2Point1Degrees();

SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd h:mm:ss a z"); //set the output format
sdf.setTimeZone(czc.getGeoLocation().getTimeZone()); //set the formatter's time zone
System.out.println("Bein Hashmashos 18 min:     " + sdf.format(bh18Min));
System.out.println("Bein Hashmashos 3.05°:      " + sdf.format(bh3Pt05Deg));
System.out.println("Bein Hashmashos 16.875 min: " + sdf.format(bh16Pt875Min));
System.out.println("Bein Hashmashos 2.8°:       " + sdf.format(bh2Pt8Deg));
System.out.println("Bein Hashmashos 13.5 min:   " + sdf.format(bh13Pt5Min));
System.out.println("Bein Hashmashos 2.1°:       " + sdf.format(bh2Pt1Deg));

The output of the above code (assuming that the calendar was set to March 16, 2020).

Bein Hashmashos 18 min:     2020-03-16 5:29:58 PM IST
Bein Hashmashos 3.05°:      2020-03-16 5:29:40 PM IST
Bein Hashmashos 16.875 min: 2020-03-16 5:31:05 PM IST
Bein Hashmashos 2.8°:       2020-03-16 5:30:51 PM IST
Bein Hashmashos 13.5 min:   2020-03-16 5:34:28 PM IST
Bein Hashmashos 2.1°:       2020-03-16 5:34:09 PM IST

Latest Kiddush Levana Time – Location, Location, Location

The full moon visible from Jerusalem’s Inbal hotel sukkah.

In the previously published Zmanim For Kiddush Levana Before Shavuos 5778 article, we demonstrated how location plays a key role in the earliest time one can recite Kiddush Levana / קידוש לבנה. This article will focus on the Sof Zman Kiddush Levana, or the latest that one can recite Kiddush Levana. In the past we posted the technical Calculating Kiddush Levana Times Using the Zmanim API post, with a simple example of using the KosherJava Zmanim API to calculate Kiddush Levana. Here is a slightly more complex example.
The Bach on the Tur Hilchos Kiddush Hachodesh (Orach Chayim תכ”ו 426) discusses not reciting Kiddush Levana on Yom Tov. He writes that in Tishrei 5390 (1629) there was cloud cover from Yom Kippur until the first night of Succos. The Bach who was the Rabbi in Kraków at that time (see the Be’er Haitev 426:5), writes that they said Kiddush Levana on the first night of Sukkos. This is right after he mentioned that it is our custom not to recite Kiddush Levana after halfway between molad and molad (following the Maharil and Rema, and not the Mechaber who allows a little extra time). Was tzais (the earliest time to recite Kiddush Levana), on the first night of Succos in Kraków that year (5390 / 1629) after the midpoint between molad and molad? Is the Bach saying that in this case bedieved you should still recite Kiddush Levana, or is he just saying that it can be said on Yom Tov when waiting until after Yom Tov will be too late?

The Impact of Calendar Dechiyos / דחיות

The day of the molad of Tishrei is the target day for the first day of Rosh Hashana. However, the Jewish calendar has four rules that delay the start of the Jewish year by a day or two (in a case of two delays combining), a subject that we will hopefully cover at some point – עוד חזון למועד. If not for these delays known as dechiyos that occur about 60% of all years, the 15th night of the month of Tishrei, would always be early enough to recite Kiddush Levanah. The average lunar month is a drop over 29 and a half days (29 days, 12 hours, 44 minutes and 3.3 seconds), so the halfway point that is the end of the earlier time quoted by the Bach would be 14 days, 18 hours and 22 minutes after the molad. The calculation below shows that in the case of 15 Tishrei, 5390 (the evening of Oct 1, 1629), even the earlier zman for sof zman Kiddush Levana did not happen until the morning of the first day of Succos. The molad of Tishrei that year was about 2.5 hours before the day’s end. This resulted in a dechiya of Molad Zaken / מולד זקן. This delayed Rosh Hashanah by a day pushing it from Monday to Tuesday. There was no dechiya of Lo ADU Rosh / לא אד״ו ראש, so the delay was not as long as it could have been (had there been a combination of the two dechiyos). Sunset on the first night of Sukkos that year in Krakow was at 5:18 pm (using standard time), and the moon rose at 5:54 pm, so they were able to recite Kiddush Levana that night.

Despite dechiyos, the time of tzais in Krakow is before sof zman Kiddush Levana on the the first night of Succos approximately 73% of the time, making the ability to recite Kiddush Levanah on the first night of Sukkos for the longitude of Krakow (that is close to Yerushalayim) more common than not. As you will see below, the farther west you go, the less likely it is to happen.

Sof Zman Kiddus Levana Around the World

Being that Sof Zman Kiddush Levana is a fixed time globally, and can’t be said before local tzais, the farther west you are, the less of a probability you have of encountering a late Kiddush Levana. Conversely, the farther east you are, the greater your probability is of encountering a late Kiddush Levana. The chart below was inspired by Rabbi Dovid Heber’s example in his sefer Shaarei Zmanim of the rare ability to recite Kiddush Levana on the 17th of the month in Anadyr, Russia. This town is at the far eastern portion of Russia, not far from the International Date Line. The chart shows the percentage of times that Sof Zman Kiddush Levana in Tishrei and the annual average for various places around the world occurs after tzais (calculated as 8.5°) on the 15th, 16th and 17th of the month.

15th – ט״ו16th – ט״ז17th – י״ז
Anadyr, Russia91%57%46%18%N/A0.2%
Sydney, Australia88%73%42%21%N/AN/A
Krakow, Poland73%55%22%7%N/AN/A
Lakewood, NJ62%41%8%1.6%N/AN/A
Los Angeles, CA56%35%3%0.7%N/AN/A
Kurima Island, Japan
(Chazon Ish)

Molad Calculation Code Sample

The code below shows rudimentary use of the Jewish Calendar functionality and molad retrieval for the historical date of the Bach’s 1629 Sukkos night kiddush levanah.

int month = JewishDate.TISHREI;
int year = 5390;
JewishDate erevSukkos = new JewishDate(year, JewishDate.TISHREI, 14);
JewishDate molad = JewishDate.getMolad(year, month);
Date tchilas3Days = JewishCalendar.getTchilasZmanKidushLevanah3Days(year, month);
Date tchilas7Days = JewishCalendar.getTchilasZmanKidushLevanah7Days(year, month);
Date sofZmanBetweenMoldos = JewishCalendar.getSofZmanKidushLevanahBetweenMoldos(year, month);
Date sofZmanKidushLevanah15Days = JewishCalendar.getSofZmanKidushLevanah15Days(year, month);
TimeZone krakowTZ = TimeZone.getTimeZone("Europe/Warsaw");
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd, yyyy 'at' HH:mm:ss z");
SimpleDateFormat dayFormat = new SimpleDateFormat("MMM dd, yyyy");
System.out.println("Molad: " + molad + " / " + dayFormat.format(molad.getTime()) + ", day of week: "
		+ molad.getDayOfWeek() + ", Hours: " + molad.getMoladHours() + ", minutes: " + molad.getMoladMinutes()
		+ ", Chalakim: " + molad.getMoladChalakim());
System.out.println("Tchilas Zman Kidush Levanah 3 Days: " + sdf.format(tchilas3Days));
System.out.println("Tchilas Zman Kidush Levanah 7 Days: " + sdf.format(tchilas7Days));
System.out.println("Erev Succos: " + erevSukkos + " / " + dayFormat.format(erevSukkos.getTime()));
System.out.println("Sof Zman KidushLevanah Between Moldos: " + sdf.format(sofZmanBetweenMoldos));
System.out.println("Sof Zman Kidush Levanah 15 Days: " + sdf.format(sofZmanKidushLevanah15Days));

The output in Central European Time (CET) is:

Molad: 29 Elul, 5389 / Sep 17, 1629, day of week: 2, Hours: 15,
        minutes: 46, Chalakim: 5
Tchilas Zman Kidush Levanah 3 Days: Sep 20, 1629 at 14:25:19 CET
Tchilas Zman Kidush Levanah 7 Days: Sep 24, 1629 at 14:25:19 CET
Erev Succos: 14 Tishrei, 5390 / Oct 01, 1629
Sof Zman KidushLevanah Between Moldos: Oct 02, 1629 at 08:47:21 CET
Sof Zman Kidush Levanah 15 Days: Oct 02, 1629 at 14:25:19 CET

Odds & Ends

While Tishrei has much higher odds than most months for a late Sof Zman Kiddush Levana, Shevat is very close to Tishrei, and sometimes exceeds it. Cheshvan and Kislev are the only variable length Jewish months. In a chaser (Deficient / short) year they will both have the short month length of 29 days. The months of Cheshvan and Kislev are followed by Teves that is always 29 days. With the possibility of three 29 day months in a row, and being in the winter with early Tzais times, the month of Shevat is the most likely to have a very late sof zman Kiddush Levana, as pointed out by Rabbi Heber in his Shaarei Zmanim.

The reason that Anadyr only has a 57% chance of being able to recite Kiddush Levana year-round on the 15th VS 73% in Sydney, even though Anadyr is 3% more likely to have Kiddush levana on the 15th of Tishrei, is due to the high latitude of Anadyr (64.7° N) that results in 25.4% of the months not having tzais on the 15th.

The closest case to almost not being able to recite Kiddush levanah on the 15th of Tishrei without dechiyos would be in a location immediately to the east of the Chazon Ish dateline such as Kurima Island on a year when the molad was exactly at sunset in Yerushalayim and the true opposition (full moon) was much earlier than the average opposition, causing the moon to rise after sof zman kidush levana. Calculations show that this would never actually happen on Sukkos though it is likely to occur on Pesach since the molad of Nisan is much more likely to be before Rosh Chodesh.

Baal Hatanya’s Zmanim Added to KosherJava Zmanim Library

Baal Hatanya Zmanim (Photo With Hourglass)
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 the Baal Hatanya in the סדר הכנסת שבת Seder Hachnasas Shabbos,

Seder Hachnasas Shabbos -Shkiah Amitis

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

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 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 @

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 spent 2 years researching, have a haskama (endorsement) from Chabad Dayanim. 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, I was able to confirm that the Baal Hatanya zmanim generated by the KosherJava zmanim library match the 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 based on the opinion of Rabbi SDB Levin and Rabbi Feigeslstock — but there are Chabad rabbis that do not agree with their interpretation.

I expect a future post on the subject at some point in the future.

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);
omplexZmanimCalendar 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 for reviewing this post.

FAQ: Different Parshas Hashavua in Eretz Yisrael Than Chutz La’aretz


Why does the KosherJava Zmanim API seem to sometimes return the incorrect parshas hashavua in Israel?


I have had a number of inquiries this year about the incorrect Parshas Hashavua being returned by the API. In all cases this has been a complaint for Eretz Yisrael and not Chutz La’aretz. The explanation is pretty simple and covered in the API documentation for the JewishCalendar class, but may not be clear to all. When the first day of Pesach occurs on a Shabbos, as it did this year (5775), the last day of Pesach in Eretz Yisrael is on a Friday. The following day is a regular Shabbos in Eretz Yisrael with the usual krias hatorah, but in chutz la’aretz it is the 8th day of Pesach, resulting in Pesach kriah. The following weeks will have different krias hatorah in Eretz Yisrael vs chutz la’aretz, and this will continue for a number of weeks until a double parsha in chutz laaretz is added to equalize the parsha. This last occurred in 2012 (before the release of the calendar functionality in the Zmanim 1.3 release), and will occur again next year. If you are coding to display the Parshas Hashavuah for use in Israel, it is important to set the inIsrael flag (it defaults to false).


A fuller example showing how to set the indicator and showing the comparison of Eretz Yisrael and Chutz Laaretz this year can be seen in this example.

JewishCalendar israelCalendar = new JewishCalendar(5775, JewishDate.NISSAN, 7);
israelCalendar.setInIsrael(true); //set the calendar to Israel
JewishCalendar chutsLaaretzCalendar = new JewishCalendar(5775, JewishDate.NISSAN, 7);
chutsLaaretzCalendar.setInIsrael(false); //not really needed since the API defaults to false
HebrewDateFormatter hdf = new HebrewDateFormatter();
System.out.println("Date\tChutz Laaretz / Eretz Yisrael"));
for(int i = 0; i < 57; i++){
	israelCalendar.forward(); //roll the date forward a day
	chutsLaaretzCalendar.forward(); //roll the date forward a day
	if(chutsLaaretzCalendar.getDayOfWeek() == 7){ //ignore weekdays
		System.out.println(hdf.formatParsha(chutsLaaretzCalendar) + "\t" + hdf.formatParsha(israelCalendar) + " \\ " + hdf.format(chutsLaaretzCalendar));

the output of this is

Date               Chutz Laaretz / Eretz Yisrael
8 Nissan, 5775     Tzav / Tzav
15 Nissan, 5775     / 
22 Nissan, 5775     / Shmini
29 Nissan, 5775    Shmini / Tazria Metzora
6 Iyar, 5775       Tazria Metzora / Achrei Mos Kedoshim
13 Iyar, 5775      Achrei Mos Kedoshim / Emor
20 Iyar, 5775      Emor / Behar
27 Iyar, 5775      Behar Bechukosai / Bechukosai
5 Sivan, 5775      Bamidbar / Bamidbar

It should be noted that this discrepancy is not rare and happens about 25% of the calendar years.

FAQ: Calculating the Baal Hatanya’s Shkiah

Baal Hatanya Zmanim

Please see the more recent and updated article Baal Hatanya’s Zmanim Added to KosherJava Zmanim Library for more current information.


How do I calculate the Baal Hatanya’s Zman for Shkiah as 4 minutes after sunset using the KosherJava Zmanim API?


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.