KosherJava Zmanim Library 3.0.0 Released


The KosherJava Zmanim API version 3.0.0 was released on Oct 21, 2026 י׳ חשון תשפ״ז in Maven and GitHub.

This is a major release, and unlike the releases that came before it, it will break existing code. The API has moved to java.time, a number of classes and methods were renamed, and the methods that had been deprecated over the years were removed. The zmanim themselves are almost all unchanged; what changed is what they are called and what type they return. Allow some time for the upgrade, and see the full list of changes since the 2.5.0 release in GitHub.

New in Version 3.0.0

Two New Calculators

  • The MeeusCalculator implements Jean Meeus’s high-accuracy algorithm. The existing NOAACalculator, which remains the default, is based on NOAA‘s implementation of his low-accuracy algorithm.
  • The SPACalculator implements the Solar Position Algorithm. Both new calculators are more accurate and slower than the NOAA calculator, though for practical zmanim the difference is a matter of seconds.
  • The USNO-based SunTimesCalculator is now deprecated. It is less accurate than the other three and is only being kept for reference and comparison with older implementations.

Breaking Changes

  • The minimum supported JRE is now Java 11, up from Java 8. Note that the JavaDocs only generate properly under Java 21. This affects generating the documentation, not the compiled code, which continues to target Java 11.
  • The API uses java.time throughout. All zmanim return Instants rather than Dates, sha’os zmaniyos return a Duration (and null rather than Long.MIN_VALUE when not applicable), Calendar and GregorianCalendar gave way to LocalDate and ZonedDateTime, TimeZone to ZoneId, and SimpleDateFormat to DateTimeFormatter. The now obsolete com.kosherjava.util.Time class was removed.
  • The confusingly named ComplexZmanimCalendar is now the ComprehensiveZmanimCalendar.
  • Generically named methods in the ZmanimCalendar were renamed to say which opinion they calculate. The zmanim did not change, only the names: getTzais() is now getTzaisGeonim8Point5Degrees(), getAlosHashachar() is getAlos16Point1Degrees(), getSofZmanShmaMGA() is getSofZmanShmaMGA72Minutes(), and getMinchaGedola(), getMinchaKetana() and getPlagHamincha() gained a GRA suffix. Minute-based zmanim now spell out Minutes, and getChatzos() is getChatzosHayom().
  • Parsha was renamed Parshah, in the formatters as well, and the misspelled isAssurBemlacha() and getBainHasmashos() methods were corrected.
  • Deprecated methods flagged for removal are gone, among them getSofZmanShmaKolEliyahu(), the fixed local chatzos based zmanim, and the JewishCalendar tefila methods that moved to TefilaRules. The redundant GeoLocationUtils class was removed in favor of GeoLocation.
  • A few zmanim that were a drop too early were corrected. getTzaisGeonim4Point37Degrees() is now getTzaisGeonim4Point42Degrees() and getTzaisGeonim4Point61Degrees() is getTzaisGeonim4Point66Degrees(). getTzaisGeonim5Point88Degrees() was removed.
  • The getSofZman*Chametz* methods return null when it is not Erev Pesach.
  • The source is now UTF-8, so the Hebrew in the documentation and code (particularly in HebrewDateFormatter) appears properly.

Chatzos

  • getChatzosHalayla() was added, calculated as astronomical midnight rather than as halfway between sunset and sunrise or twelve hours after chatzos hayom.
  • Two settings control how chatzos is used: useAstronomicalChatzos (on by default, retaining the backwards compatibility break introduced in 2.5.0) and useAstronomicalChatzosForOtherZmanim (off by default). getChatzosAsHalfDay() returns half-day chatzos regardless of the setting.
  • The generic getHalfDayBasedZman(startOfHalfDay, endOfHalfDay, hours) replaces getFixedLocalChatzosBasedZmanim() and allows other zmanim to be based on chatzos, and getPercentOfShaahZmanisFromDegrees(degrees, sunset) simplifies percentage-of-the-day calculations.

The Sun’s Position, and the Arctic

  • Solar azimuth and elevation were fixed in the NOAACalculator, and getSolarAzimuth(Instant, GeoLocation) and getSolarElevation(Instant, GeoLocation) were added to the AstronomicalCalculator, along with getTimeAtAzimuth(azimuth) in the AstronomicalCalendar.
  • The sun’s apparent angular semi-diameter for the day is now used by default rather than a fixed radius.
  • getPolarPlagHaminchaBenIshChai() and getPolarStartOfDayTeshuvosVehanhagos() were added for latitudes where the sun does not cross the horizon, together with getSunriseOrEasternmostSolarAzimuth() and getSunsetOrWesternmostSolarAzimuth().
  • The USNO noon calculation was corrected in locations where it was sometimes twelve hours off, and getInstantFromTime() was tweaked to address issues near the dateline.

The Calendar Classes

  • JewishCalendar gained getTekufa() and getTekufaAsInstant() for the tekufos, plus and minus methods for years, months and days matching LocalDate, and a public isJewishLeapYear(int). isHavdalahRecited() was renamed isTonightMutarBemelacha(), isYomTov() now returns true for 20 Nissan, and getDaysInJewishMonth() and getLastDayOfGregorianMonth() take their parameters in year, month order.
  • HebrewDateFormatter gained formatParsha(Parshah), and getHebrewMonthList() / setHebrewMonthList(String[]), which allow overriding the default month names such as Cheshvan to Marcheshvan.
  • TefilaRules gained isMizmorLesodaRecited(), and no longer has Tachanun recited on Erev Rosh Hashana.
  • ComprehensiveZmanimCalendar gained getMisheyakir12Point85Degrees(), getSofZmanAchilasChametzMGA72MinutesZmanis() and getSofZmanBiurChametzMGA72MinutesZmanis(), and a getMinchaGedolaGreaterThan30(Instant) that works with any mincha gedola calculation.

A number of other small changes, null-handling corrections and bug fixes are in the full list of changes. I would like to thank Moshe Dicker, Elyahu Jacobi and Maor Na’im of RoyZmanim, and many others who helped with code that went into this release. I would also like to thank Eli Julian for his continued release support skills.

KosherJava Zmanim API 2.5.0 Released


The KosherJava Zmanim API version 2.5.0 was released on June 9, 2023 י״ג סיון תשפ״ג in Maven and GitHub.

New in Version 2.5.0

See the full list of changes between v2.4.0 and v2.5.0 in GitHub. I would like to thank Eli Julian for his continued release support skills.

Zmanim API 2.4.0 Released


The KosherJava Zmanim API version 2.4.0 was released on Nov 27, 2022 ד׳ כסלו תשפ״ג in Maven and GitHub.

New in Version 2.4.0

Zmanim API 2.3.0 Released


The KosherJava Zmanim API version 2.3.0 was released on Dec 7th, 2021 ג׳ טבת תשפ״ב in Maven and GitHub. While there have been numerous releases over the years, this is the first release-related post since the v1.3.0 release in 2013. If you have not updated since that time, you can expect some changes. The most significant changes (besides a lot of new functionality) are the simple to fix breaking changes listed below.

New in Version 2.3.0

The list of significant changes in this and previous releases can be seen in the KosherJava Zmanim API changelog.

Breaking Changes since v1.3

Rav Moshe Feinstein’s Zmanim Added to the KosherJava Zmanim API


Rav Moshe Feinstein is of the opinion that chatzos is at a fixed time all year round and is calculated based on the location’s longitude (in Lakewood, NJ it is at 11:56am / 12:56pm during DST). See Igros Moshe Orach Chaim vol 4 no. 20 who states

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

See the Igros Moshe for more details. The Aruch Hashulchan in Orach Chaim 233 no. 14 also calculates chatzos at a fixed time all year.

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

Rav Moshe also bases other zmanim calculations on this fixed local chatzos. As opposed to calculating shaaos zmaniyos from beginning to the end of a day, Rav Moshe calculates a number of zmanim based on half of the day starting or ending at fixed local chatzos (see Igros Moshe Orach Chaim vol 1, no. 23).

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

These zmanim are used in Mesivta Tiferet Yerushalayim (MTJ), Yeshiva of Staten Island and Camp Yeshiva of Staten Island. Code to calculate these Rav Moshe zmanim is now part of the latest v2.3.0 release of the KosherJava Zmanim API.
The following new zmanim are now included in the API:

Sample Usage

For developers, here is sample code that calculates the new zmanim. This should allow many zmanim apps to add Rav Moshe Feinstein’s zmanim with very little effort.

String locationName = "145 E Broadway, New York, NY";
double latitude = 40.7138;
double longitude = -73.9913;
double elevation = 11;
TimeZone timeZone = TimeZone.getTimeZone("America/New_York");
GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone);
ComprehensiveZmanimCalendar czc = new ComprehensiveZmanimCalendar(location);
czc.getCalendar().set(1986, Calendar.MARCH, 23); //Rav Moshe's petirah
System.out.println("Sof zman shma alos 18° to fixed local chatzos: " + czc.getSofZmanShmaMGA18DegreesToFixedLocalChatzos());
System.out.println("Sof zman shma alos 16.1° to fixed local chatzos: " + czc.getSofZmanShmaMGA16Point1DegreesToFixedLocalChatzos());
System.out.println("Sof zman shma alos 90 to fixed local chatzos: " + czc.getSofZmanShmaMGA90MinutesToFixedLocalChatzos());
System.out.println("Sof zman shma alos 72 to fixed local chatzos: " + czc.getSofZmanShmaMGA72MinutesToFixedLocalChatzos());
System.out.println("Sof zman shma sunrise to fixed local chatzos: " + czc.getSofZmanShmaGRASunriseToFixedLocalChatzos());
System.out.println("Sof zman tfila sunrise to fixed local chatzos: " + czc.getSofZmanTfilaGRASunriseToFixedLocalChatzos());
System.out.println("Mincha gedola 30 minutes after fixed local chatzos: " + czc.getMinchaGedolaGRAFixedLocalChatzos30Minutes());
System.out.println("Mincha katana fixed local chatzos to sunset: " + czc.getMinchaKetanaGRAFixedLocalChatzosToSunset());
System.out.println("Plag hamincha fixed local chatzos to sunset: " + czc.getPlagHaminchaGRAFixedLocalChatzosToSunset());
System.out.println("Tzais 50 minutes after sunset: " + czc.getTzais50());

Calculating other fixed local chatzos based zmanim not included in the library (and not necessarily endorsed by this shitta) are very simple with the generic getFixedLocalChatzosBasedZmanim(Date startOfHalfDay, Date endOfHalfDay, double hours) method built to simplify calculating these zmanim. Here are a few examples.

//4 hours into a day based on half the day from alos 18° to fixed local chatzos
System.out.println("Sof zman tfila 18° to fixed local chatzos: " + czc.getFixedLocalChatzosBasedZmanim(getAlos18Degrees(), getFixedLocalChatzos(), 4); 
//plag hamincha based on the second half of the day starting at fixed local chatzos and ending 50 minutes after sunset
System.out.println("Plag hamincha fixed local chatzos to tzais 50 minutes: " + czc.getFixedLocalChatzosBasedZmanim(getFixedLocalChatzos(), getTzais50(), 4.75); 

I would like to thank Avraham David Gelbfish who requested this addition and provided instructions on the proper calculations used by these yeshivos in calculating the zmanim.