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 and calculate the exact time the picture was taken based on the shadows.
Tag: Zmanim
Zmanim API 1.3.0 Released
The Zmanim API version 1.3.0 was released on March 4th, 2013 כ״א אדר תשע״ג. Various changes in the new release VS the previous version 1.2.1 that was released in May 2010 can be seen below. This release includes beta support for Jewish Calendar calculations as well as a number of updated zmanim and refactored code. The Jewish Calendar support in the Zmanim API is based on Avrom Finkelstien’s HebrewDate project released in 2002. Unlike the Zmanim code, the Jewish calendar interfaces may change significantly in the future (see Jay Gindin’s various changes that may make it into this API) and should therefore be considered beta.
Changes in the Zmanim API 1.3.0 release
- Refactoring of zmanim calculations to allow more flexibility in generating custom zmanim. New generic methods that take an arbitrary start and end of day for many zmanim such as sofZmanShema and getPlagHamincha etc. This makes calculating atypical zmanim that I had not anticipated when creating the API. I receive such requests from time to time, and the changes greatly simplify these types of calculations. Examples of recent requests are:
- Zman krias Shema calculated from alos as 72 minutes before netz and tzais as 7.083 degrees
- Plag hamincha from alos 7.083° to tzais 7.083°
- Many rounds of general code refactoring to simplify and stabilize the code and make it easier to port. Thank you Jay Gindin for his many suggestions.
- The addition of Erev Pesach zmanim to the Zmanim API
- Added Tzais Geonim 3.676 degrees (18 minutes as calculated by Stanley Fishkind)
- Calculation of Kiddush Levana and molad times
- Hebrew calendar support (with formatters and Yom Tov calendar)
- Daf Yomi calendar
- A number of bug fixes including a fix to DST correction, and a calendar date correction
- Changing the license of the KosherJava Zmanim API from GPL 2 to LGPL 2.1
- Many additions and clarifications to the Zmanim API JavaDoc documentation. My thanks to Reb Feivel Muller for his valuable input.
- Removal of the deprecated (and inaccurate) JSuntimeCalculator.java class. This has been deprecated since 2008. The NOAACalculator replaced this class.
- Deprecation of the getSofZmanShmaKolEliyahu() method. Thank you to Rabbi Yisroel Boruch Twerski for pointing out that the Yisrael Vehazmanim was incorrect in including this zman. This is something he discussed with Rabbi Harfenes.
- Uniformly return zmanim based on sea level sunrise and sunset. Most zmanim had this fix a long time ago, but there were a few zmanim such as candle lighting time that were corrected.
- The getCandleLighting() method had a spelling correction (it had been getCandelLighting)
Changes since March 23, 2011 have been in SVN and detailed changes can be seen there.
Zmanim Map 3.5 adds Date and Algorithm Selection
The Zmanim Map was recently updated to version 3.5. This new release adds a number of new features (listed below), and some technical changes over the previous Zmanim Map 3.0 release. With this release, the main focus of the map has shifted to the zmanim tabs. The direction to Yerushalayim tab with davening directions using both the rhumb line and great circle route to Yerushalayim is still present, but is no longer the default tab.
- The date can now be selected by the user. In previous versions the date was always the current date on the user’s computer (though the map always supported passing the date on the URL using the undocumented date=1969-02-08 parameter). The current date is still the default, but the user can now change the date.
- The calculation algorithm is now selectable. The Zmanim API supports both the USNO and NOAA algorithms. The map has always used the USNO algorithm, and this remains the default, but users can now use the NOAA algorithm.
- The Zmanim tab is now the default tab. This reflects user feedback indicating that most people use the map for zmanim.
- An About tab now provides a mini user guide and general information about the map.
- The timezone look-up now uses the Google Time Zone API. Previously the map had been using the Geo Names web service. Since the elevation service also uses Google, the change to a single stable source will hopefully result in fewer outages.
- The currently selected tab persists across location changes, so if you were viewing zmanim for a location, and changed the location to see how the zmanim were affected, you will no longer have to change tabs after each move.
- Candle Lighting was added for Fridays. Erev Yom Tov will not show candle lighting at this point.
- Performance improvements, minor enhancements, bug fixes and refactoring
KosherJava Zmanim API Powering Many Mobile Apps
In the past I posted about Android Zmanim, Jay Gindin’s open source Android zmanim project that uses the KosherJava Zmanim API. The fact that Android development uses Java natively means that it is very simple for Android developers to include zmanim in their apps. Since that time there have been a number of other applications (including iPhone apps) using the code. Moshe’s KosherCocoa Obj-C port of the KosherJava Zmanim API will probably result in additional iPhone apps that use the API. Yitzchok’s older Zmanim .NET port of the KosherJava Zmanim API also opened the door for Windows Phone zmanim applications as well (Ari Polski’s
Zmaim app already uses it, and there are others in the works). I may post additional details about some of them in the future, including an updated post about Jay’s latest Android Zmanim release. I am aware of the following mobile applications that use the KosherJava Zmanim API.
- Android Zmanim (Android)
Zmantime Alarm Clock (Android)- Daily Zmanim (Android)
- Matanya Beezy
WiseChild Zmanim - Matanya Beezy
Ice Cream Siddur YahrtzeitZmanim (Android)Hebrew Calendar (Android)- Simple Luach (Jewish calendar) (Android)
Zmanim (Windows Phone)- Siddur (RustyBrick) (iPhone)
mMinyan (for both Android and iPhone)- ZmanimMinder (Android)
- Find a Minyan (Android)
- Siddur (OKTM) (Android)
- Jewish Cal (iPhone)
Smart Siddur (Android)- Zmanim (iPhone>.ש< )
- Ultimate Omer 2 (iPhone)
- Sefirat Haomer (Android)
- Shabbat Shalom (Android and iPhone)
Daka Tora (Android) an app for Jewish soldiers- Mincha Alerts (iPhone)
- Shabbos Zmanim (Android)
Easy Zmanim (Android)- Halachic Times (Android)
- Jewish Automator Tasker Plugin, a Tasker plugin (Android)
There are also a few secular apps that are non-zmanim specific that use the API for sunrise and sunset calculations. One that I know of is Jeffrey Blattman’s Dawn to Dusk Widget, and I know that there are some photography apps that use it for sunrise/set calculations as well. There are likely more that I have missed, and a few that are in active development but unreleased. If you are aware of any missed apps, please let me know.
FAQ: Outputting Zmanim for A Different Time Zone With the Zmanim API
Question:
Why does the output of zmanim for a different time zone appear incorrect?
Answer:
One of the common issues encountered by developers using the API is that zmanim generated for a different time zone than the user’s time zone may return output that appears incorrect. For example a user in Lakewood, NJ trying to calculate sunrise for Yerushalayim may attempt to use the following code:
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); zc.getCalendar().set(2011, Calendar.FEBRUARY, 8); System.out.println("Sunrise: " + zc.getSunrise()); System.out.println("Sunset: " + zc.getSunset());
While you would expect a sunrise of 6:27:41 AM and sunset of 5:19:19 PM, running this code on a computer anywhere in the Eastern Standard time zone would generate the following time that appears to be 7 hours early:
Sunrise: Mon Feb 07 23:27:41 EST 2011 Sunset: Tue Feb 08 10:19:19 EST 2011
The issue is simple, and the sunrise and sunset returned above are actually accurate. Zmanim are returned by the Zmanim API as a Java Date object that represents a moment in time (stored internally by Java as Unix Time – the number of milliseconds since the January 1, 1970 GMT). Sunrise in Yerushalayim on February 8th actually happens at 11:27:41 PM on February 7th EST. Java is simply outputting the Date as a String formatted to the users default time zone (EST in this example). The user probably intends to output the time in IST – Israel Standard Time (“Asia/Jerusalem” in the Olson database). To do this you have to output the zmanim using a formatter set to use the “Asia/Jerusalem” time zone.
DateFormat zmanimFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); zmanimFormat.setTimeZone(location.getTimeZone()); System.out.println("sunrise: " + zmanimFormat.format(zc.getSunrise())); System.out.println("sunset:" + zmanimFormat.format(zc.getSunset()));
will output the expected
sunrise: Tue Feb 08 06:27:41 IST 2011 sunset:Tue Feb 08 17:19:19 IST 2011
Below is the full code example.
import com.kosherjava.zmanim.*; import com.kosherjava.zmanim.util.*; import java.util.TimeZone; public class FormatZmanim{ public static void main(String [] args) { String locationName = "Jerusalem"; double latitude = 31.778; //latitude of Har habayis double longitude = 35.2354; //longitude of Har Habayis double elevation = 0; //optional elevation //use a Valid Olson Database timezone listed in java.util.TimeZone.getAvailableIDs() TimeZone timeZone = TimeZone.getTimeZone("Asia/Jerusalem"); //create the location object GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone); ZmanimCalendar zc = new ZmanimCalendar(location); //create the ZmanimCalendar zc.getCalendar().set(2011, Calendar.FEBRUARY, 8); //set the date DateFormat zmanimFormat = new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy"); //Create the formatter zmanimFormat.setTimeZone(location.getTimeZone()); //set the formatter's time zone System.out.println("sunrise: " + zmanimFormat.format(zc.getSunrise())); System.out.println("sunset:" + zmanimFormat.format(zc.getSunset())); } }