The Zmanim API did not have dedicated zmanim to calculate the Erev Pesach zmanim of sof zman achilas chametz (the latest time one can eat chametz), and sof zman biur chametz (the latest time to burn chametz) till the April 14 check in to the KosherJava Zmanim Project GitHub repository. The latest time for eating chametz is at the end of the fourth hour of the day. This corresponds to sof zman tfila. The API has about 12 of those, so that does not require any special programming, but to help developers who are unaware of how they work I created three wrapper getSofZmanAchilasChametz methods (getSofZmanAchilasChametzGRA(), getSofZmanAchilasChametzMGA72Minutes() and getSofZmanAchilasChametzMGA16Point1Degrees()) calling the three most commonly used getSofZmanTfila methods (getSofZmanTfilaGRA(), getSofZmanTfilaMGA72Minutes() and getSofZmanTfilaMGA16Point1Degrees()).
null on any day other than Erev Pesach.For example, here is the current code used in getSofZmanAchilasChametzGRA():
public Instant getSofZmanAchilasChametzGRA() {
return getSofZmanAchilasChametz(getSunriseBasedOnElevationSetting(), getSunsetBasedOnElevationSetting(), true);
}The API itself is very flexible, and as long as you know the calculation of the zman, you can easily calculate it. For example, to calculate sof zman biur chametz according to the GRA, the time would be 5 shaos zmaniyos after sunrise. Using the Zmanim API this would be coded as:
Instant sofZmanBiurChametzGra = getTimeOffset(getSeaLevelSunrise(), getTemporalHour().multipliedBy(5));The current code used in the API is:
public Instant getSofZmanBiurChametzGRA() {
return getSofZmanBiurChametz(getSunriseBasedOnElevationSetting(), getSunsetBasedOnElevationSetting(), true);
}Developers who want to use the current API to generate these zmanim can use the following sample as a guide.
String locationName = "Lakewood, NJ";
double latitude = 40.09596; // Lakewood, NJ
double longitude = -74.22213; // Lakewood, NJ
double elevation = 0; // optional elevation
ZoneId timeZone = ZoneId.of("America/New_York");
GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone);
ComprehensiveZmanimCalendar czc = new ComprehensiveZmanimCalendar(location);
czc.setLocalDate(LocalDate.of(2011, Month.APRIL, 18)); // Erev Pesach 5771
DateTimeFormatter tf = DateTimeFormatter.ofPattern("EEE MMM d h:mm:ss a z yyyy").withZone(timeZone);
System.out.println("Erev Pesach Zmanim for " + locationName);
System.out.println("Sof Zman Achilas Chametz GRA: " + tf.format(czc.getSofZmanAchilasChametzGRA()));
System.out.println("Sof Zman Biur Chametz GRA: " + tf.format(czc.getSofZmanBiurChametzGRA()));
System.out.println("Sof Zman Achilas Chametz MGA 72 Minutes: " + tf.format(czc.getSofZmanAchilasChametzMGA72Minutes()));
System.out.println("Sof Zman Biur Chametz MGA 72 Minutes: " + tf.format(czc.getSofZmanBiurChametzMGA72Minutes()));
System.out.println("Sof Zman Achilas Chametz MGA 16.1 Deg: " + tf.format(czc.getSofZmanAchilasChametzMGA16Point1Degrees()));
System.out.println("Sof Zman Biur Chametz MGA 16.1 Deg: " + tf.format(czc.getSofZmanBiurChametzMGA16Point1Degrees()));This would output:
Erev Pesach Zmanim for Lakewood, NJ
Sof Zman Achilas Chametz GRA: Mon Apr 18 10:42:42 AM EDT 2011
Sof Zman Biur Chametz GRA: Mon Apr 18 11:49:39 AM EDT 2011
Sof Zman Achilas Chametz MGA 72 Minutes: Mon Apr 18 10:18:42 AM EDT 2011
Sof Zman Biur Chametz MGA 72 Minutes: Mon Apr 18 11:37:39 AM EDT 2011
Sof Zman Achilas Chametz MGA 16.1 Deg: Mon Apr 18 10:14:02 AM EDT 2011
Sof Zman Biur Chametz MGA 16.1 Deg: Mon Apr 18 11:35:24 AM EDT 2011
Thanks to 
