Rarely do you find zmanim that are days apart based on your location, but this year, that is exactly what will happen. With Shavuos falling on a Sunday and Monday, we end up with a “three-day Yom Tov” that impacts the earliest time / zman that קידוש לבנה Kiddush Levana can be said (for those who say it 3 days after the מולד molad). With the minhag that Kiddush Levana is not said on Shabbos or Yom Tov, there is only a small chance to say Kiddush Levana on Thursday night, depending on your location. The molad for the month of Sivan was at 6:00:23 am in Yerushalayim (5:21 am and 6 chalakim local mean time using the traditional calculation) on Rosh Chodesh Sivan, Tuesday, May 15. This results in techilas zman Kiddush Levana 3 days later at 6:00:23 am Friday morning, May 18. This is well after the moon sets, and actually after the sun rises. It can’t be said on Friday night or Motzai Shabbos, since they are Shabbos and Yom Tov. The earliest it can be said in Israel is on Sunday night. Much farther west in NY or Lakewood, NJ, where 2 days of Yom Tov are observed, you get close to being able to say it on Thursday night, but not close enough. Kiddush Levana could theoretically be said at 11:00 pm Thursday night, but by that time, the moon will already have set (at 10:38 pm in Lakewood, and at 10:39 pm in Brooklyn, NY) and you end up having to wait until Monday night to say Kiddush Levana. From 11:00 pm on Monday night, even those who do not recite Kiddush Levana until 7 days after the molad can say it (moonset is at 1:20 am). Traveling farther west to Cleveland, OH with a moonset of 11:14 pm would seem to allow Kiddush Levana to be said on Thursday night. However, with the moon this close to the horizon, it would be almost impossible to see the moon and say Kiddush Levana on Thursday night before the moon sets. Going a little farther west, we hit the first locations that can say Kiddush Levana on Thursday night. Chicago (and other areas along its longitude) with a techilas zman Kiddush Levana of 10:00 pm and a moonset of 10:40 pm would likely be the first places in the world to say Kiddush Levana this year.
Thus, from Chicago to the west coast of the USA and Canada, Kiddush Levana can be said 3 days before Israel, and 4 days before Europe and eastern USA and Canada.
Parsha Code Removed from KosherJava Zmanim Calendar API
Due to licensing issues that were brought to my attention last year, the parsha code was removed from the Zmanim API on August 22, 2016. In the future I may release the parsha code as a standalone module under the GPL, or create a new LGPL implementation. To understand this more clearly, the current Zmanim API is licensed under the LGPL, while the parsha code contained some GPL code that had to be removed in order to keep the API under the LGPL. I would welcome any code submission for parsha code that could be released under the LGPL.
Update: Parsha Code Restored
On November 17, 2019 – י״ט מרחשון תש״פ, an updated post Parsha Code Restored to the KosherJava Zmanim Calendar API announced the restoration of the parsha functionality.
FAQ: Different Parshas Hashavua in Eretz Yisrael Than Chutz La’aretz

Question:
Why does the KosherJava Zmanim API seem to sometimes return the incorrect parshas hashavua in Israel?
Answer:
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 eighth day of Pesach, with the krias hatorah for Pesach. 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 la’aretz brings the two back in sync. 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 hashavua for use in Israel, it is important to call setInIsrael(true) on the calendar (it has a default of false).
jewishCalendar.setInIsrael(true);A fuller example showing how to set the indicator and showing the comparison of Eretz Yisrael and chutz la’aretz 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 chutzLaaretzCalendar = new JewishCalendar(5775, JewishDate.NISSAN, 7);
chutzLaaretzCalendar.setInIsrael(false); //not really needed since the API defaults to false
HebrewDateFormatter hdf = new HebrewDateFormatter();
System.out.println(String.format("%-18s %s", "Date", "Chutz Laaretz / Eretz Yisrael"));
for (int i = 0; i < 57; i++) {
israelCalendar.plusDays(1); //roll the date forward a day
chutzLaaretzCalendar.plusDays(1); //roll the date forward a day
if (chutzLaaretzCalendar.getDayOfWeek() == 7) { //only output Shabbos
System.out.println(String.format("%-18s %s / %s", hdf.format(chutzLaaretzCalendar),
hdf.formatParshah(chutzLaaretzCalendar), hdf.formatParshah(israelCalendar)));
}
}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 / BamidbarIt should be noted that this discrepancy is not rare. Besides years when the first day of Pesach is on Shabbos, it also happens when Pesach starts on a Thursday, since the second day of Shavuos then falls on Shabbos in chutz la’aretz. Between the two, the krias hatorah differs for part of the year in a little more than half of all years.
FAQ: Calculating the Baal Hatanya’s Shkiah

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 shkiah, based on the opinion 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 use the API assuming that it is a fixed 4 minutes after sunset. The technique to calculate this with the API is the same as the way getTzais72Minutes() is calculated. The source of that method is
public Instant getTzais72Minutes() {
return getTimeOffset(getSunsetBasedOnElevationSetting(), Duration.ofMinutes(72));
}The getTimeOffset(Instant time, Duration offset) method in the base class AstronomicalCalendar is very simple:
public static Instant getTimeOffset(Instant time, Duration offset) {
if (time == null || offset == null) {
return null;
}
return time.plus(offset);
}The getTimeOffset method simply adds the offset to the time of the zman and returns the result. 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;
ZoneId timeZone = ZoneId.of("Asia/Jerusalem");
GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone);
ZmanimCalendar zc = new ZmanimCalendar(location);
Instant baalHatanyaShkiah = AstronomicalCalendar.getTimeOffset(zc.getSeaLevelSunset(), Duration.ofMinutes(4));
System.out.println("Baal Hatanya Shkiah: " + baalHatanyaShkiah.atZone(timeZone));Adding it to the API itself would be even simpler:
public Instant getShkiahBaalHatanya() {
return getTimeOffset(getSeaLevelSunset(), Duration.ofMinutes(4));
}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 December 14, 2018 – ו׳ טבת תשע״ט: This article was superseded with the more recent and corrected article Baal Hatanya’s Zmanim Added to KosherJava Zmanim Library.
Forensic Zmanim Calculations

While not a practical zmanim question, it is fascinating to see that with enough work, astronomers were able to pinpoint the exact date and time that Claude Monet painted The Cliff, Étretat, Sunset based on the position of the sun at sunset. Researchers from Texas State University published information showing that the masterpiece was painted (or more accurately, visualized in Claude Monet’s mind) at 4:53 PM on February 5th, 1883.
How the Date Was Found
The research was led by astronomer Donald Olson, who calls this kind of work “forensic astronomy”. His team traveled to Étretat on the Normandy coast, found the spot where Monet stood, and measured the cliffs and the famous rock needle. Planetarium software showed that the sun sets in the position seen in the painting during the first week of February (and again in early November, but Monet was in Étretat in February). Monet’s letters from his three-week stay in Étretat in early 1883, along with the weather records and tide tables for those days, eliminated the other dates. On February 3 he was painting at a nearby beach, and on February 4 he spent the day with his visiting brother. February 5 was the only date that matched the sun’s position, the weather and the tide level in the painting. The full details were published in the February 2014 issue of Sky & Telescope and in Olson’s book Celestial Sleuth.
Local Mean Time
The 4:53 PM time is given in local mean time, and not the clock time we are used to. In 1883 France had not yet adopted a national standard time (Paris Mean Time became the legal time in 1891), so the time in Étretat was based on the sun’s position at Étretat itself. This is the same concept used for zmanim. Chatzos and the rest of the zmanim are based on the sun’s position at your location, regardless of the time zone your clock is set to.
Checking It With the Zmanim API
The KosherJava Zmanim API can confirm that the time is consistent with the painting. Using a location at the Étretat beach, sea level sunset on February 5, 1883 was at about 5:01:38 PM local mean time, and at 4:53 PM the sun was about 0.85° above the horizon (geometric, without refraction), at an azimuth of 244° (west-southwest). That is about 8 minutes before sunset, with the sun sitting just above the sea, exactly as Monet painted it.
GeoLocation location = new GeoLocation("Etretat", 49.7057, 0.2035, 0, ZoneOffset.UTC);
ZmanimCalendar zc = new ZmanimCalendar(location);
zc.setLocalDate(LocalDate.of(1883, Month.FEBRUARY, 5));
long lmtOffsetSeconds = Math.round(location.getLongitude() * 240); //4 minutes per degree of longitude
LocalTime sunsetLmt = LocalDateTime.ofInstant(zc.getSeaLevelSunset(), ZoneOffset.UTC).plusSeconds(lmtOffsetSeconds).toLocalTime();
System.out.println("Sunset (local mean time): " + sunsetLmt); //17:01:38
Instant paintingTime = LocalDateTime.of(1883, 2, 5, 16, 53).toInstant(ZoneOffset.UTC).minusSeconds(lmtOffsetSeconds);
AstronomicalCalculator calculator = new NOAACalculator();
System.out.println("Solar elevation: " + calculator.getSolarElevation(paintingTime, location)); //0.85°
System.out.println("Solar azimuth: " + calculator.getSolarAzimuth(paintingTime, location)); //244.4°Other Forensic Astronomy
The Monet painting is not the only work of art dated this way. Ansel Adams never recorded when he took his famous photograph Moonrise, Hernandez, New Mexico. An astronomer, David Elmore, used the position of the moon to date it to October 31, 1941, but in 1991 Dennis di Cicco of Sky & Telescope redid the calculation and showed that it was actually taken at 4:49:20 PM on November 1, 1941. Olson’s book contains many more examples from art, history and literature.
A Challenge
The picture of the Kosel below was taken by my grandfather Sidney (Nesanel) Siegfried. While I can’t pinpoint the exact time the picture was taken, I do know that it was taken in the early afternoon on Aug 1st, 1932 כ״ח תמוז תרצ״ב. I leave it to the readers of this post to try to calculate the exact time the picture was taken based on the shadows. The same API methods used above (getSolarElevation and getSolarAzimuth) can be used to find the time at which the sun was in the position that cast them.
Some clues to get you started. The photo was taken in the narrow prayer alley that ran along the wall before 1967, looking north, with the Kosel on the right facing west. The wall face is in sunlight, the building at the far end of the alley faces south, and there are shadows of people and buildings on both the pavement and the wall. What is missing to solve it precisely is the exact orientation of the wall and the position and lens of the camera, so a solution should show how those were determined. Click the photo for the full-size version.
