Calculating Kiddush Levana Times Using the Zmanim API

Crescent Moon

Note: The code sample in this post has been updated for the KosherJava Zmanim 3.x API, where these are instance methods of the JewishCalendar that return a Java Instant.

Calculating the earliest and latest times for קידוש לבנה Kiddush Levana has not been part of the KosherJava Zmanim API until now. This is because unlike other zmanim that solely rely on solar calculations that are tied to the Gregorian calendar, times for Kiddush Levana depend on the Jewish calendar molad (lunar conjunction) computation. With the recent addition of Jewish calendar support to the alpha releases of the KosherJava Zmanim API 1.3, molad calculation was added, allowing for calculation of Kiddush Levana times. Times include the earliest time calculated as 3 and 7 days after the molad. Sof zman Kiddush Levana includes the מהרי״ל Maharil’s opinion in שו״ת מהרי״ל ס׳ י״ט She’elos Utshuvos Maharil no. 19 that it is calculated as halfway between molad and molad

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

and the more lenient full 15 days from the molad mentioned by the Mechaber in the Shulchan Aruch. It should be noted that some opinions hold that the Rema, who brings down the Maharil’s opinion of calculating halfway between molad and molad, is of the opinion that the Mechaber agrees with him. Also see the Aruch Hashulchan. For additional details on the subject, see Rabbi Dovid Heber’s very detailed writeup in Siman Daled (chapter 4) of Shaarei Zemanim.

Calculating the Molad

Kiddush Levana times depend on the time of the molad. The time of the molad announced in shuls on Shabbos Mevarchim is the time of the Molad Emtzai (Average Molad) in Yerushalayim local mean time. This has to be converted to standard time. Standard time uses time zones to unify clock times across a large area. With 360° of longitude around the globe, the world is divided into 24 time zones (one per hour), resulting in time zones that are 15° of longitude each. Har Habayis, with a longitude of 35.2354°, is 5.2354° away from the 30° longitude line. Multiply the 5.2354° by 4 minutes per degree (15° of longitude per hour) to reach 20.9416 minutes, or 20 minutes and 56.496 seconds (5.2354 × 4 = 20.9416). This time is subtracted from the local molad time to arrive at standard time. Since the time of the molad is at the same instant globally (unlike zmanim such as sunrise that depend on a person’s location), converting this to a user’s local time involves simply calculating the time difference between the time in Yerushalayim and your location. If daylight saving time is in use, this has to be added to the calculation. The API returns the molad as a Java Instant, and Java’s DateTimeFormatter does this conversion to any time zone without forcing the developer to do any calculations.

Calculating the Start and End of Kiddush Levana Times

The JewishCalendar class contains the methods for calculating these zmanim. Calculating tchilas zman Kiddush Levana (the earliest time Kiddush Levana can be said) is done by adding 3 days or 7 days to the molad time. Sof zman Kiddush Levana (the latest time Kiddush Levana can be said) is either the time between molad and molad, calculated by adding 14 days, 18 hours, 22 minutes and 1.666 seconds to the molad (half the 29 days, 12 hours, 44 minutes and 1 chelek (3.333 seconds)), or by adding 15 days to the molad.

Using the Zmanim API to Calculate Molad Based Times

Here is sample code for calculating various Kiddush Levana times for anywhere in the world for Shevat 5729 (1969). Since formatting an Instant requires a time zone, the simple code below formats the times in your computer’s default time zone. If you want the times for a different time zone, replace ZoneId.systemDefault() with the time zone you wish to display the times for, such as ZoneId.of("America/New_York").

JewishCalendar jc = new JewishCalendar(5729, JewishDate.SHEVAT, 1); // any day in Shevat 5729
Instant tchilas3Days = jc.getTchilasZmanKidushLevana3Days();
Instant tchilas7Days = jc.getTchilasZmanKidushLevana7Days();
Instant sofZmanBetweenMoldos = jc.getSofZmanKidushLevanaBetweenMoldos();
Instant sofZman15Days = jc.getSofZmanKidushLevana15Days();
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("MMM dd, yyyy 'at' HH:mm:ss z").withZone(ZoneId.systemDefault());
System.out.println("Tchilas Zman Kiddush Levana 3 Days: " + dtf.format(tchilas3Days));
System.out.println("Tchilas Zman Kiddush Levana 7 Days: " + dtf.format(tchilas7Days));
System.out.println("Sof Zman Kiddush Levana Between Moldos: " + dtf.format(sofZmanBetweenMoldos));
System.out.println("Sof Zman Kiddush Levana 15 Days: " + dtf.format(sofZman15Days));

This will output the following in the US Eastern time zone:

Tchilas Zman Kiddush Levana 3 Days: Jan 21, 1969 at 06:06:30 EST
Tchilas Zman Kiddush Levana 7 Days: Jan 25, 1969 at 06:06:30 EST
Sof Zman Kiddush Levana Between Moldos: Feb 02, 1969 at 00:28:31 EST
Sof Zman Kiddush Levana 15 Days: Feb 02, 1969 at 06:06:30 EST

Kiddush Levana Times During Daylight Hours

As you can see, all of these times are at night (after tzais 72 and prior to alos 72 minutes in Montreal). Many times, these calculations will result in times that are during daylight hours when Kiddush Levana can’t be said. When the calculated time of tchilas zman Kiddush Levana is during daylight hours, the earliest time should be tzais the following night. When the calculated time of sof zman Kiddush Levana is during daylight hours, the time posted should be alos on that morning. The API now supports this in the ComprehensiveZmanimCalendar, whose getTchilasZmanKidushLevana3Days(Instant alos, Instant tzais) and related methods return tzais or alos when the time falls during the day, and return null on days when the zman does not occur.