The Zmanim (“times” referring to the calculations of time that govern the start and end time of Jewish prayers and holidays) project is a Java API for generating zmanim from within Java programs. The Java Zmanim API has been ported to .NET (Jewish Zmanim Framework) and Objective-C (KosherCocoa). If you are a non programmer, this means that the software created by the project is a building block of code to allow other programmers to easily include zmanim in their programs. The basis for most zmanim in this class are from the sefer Yisroel Vehazmanim by Rabbi Yisroel Dovid Harfenes. The code available under the LGPL license can now be downloaded from the KosherJava Zmanim code repository. Older stable releases can be downloaded from the download page.
Please note: due to atmospheric conditions (pressure, humidity and other conditions), calculating zmanim accurately is very complex. The calculation of zmanim is dependant on Atmospheric refraction (refraction of sunlight through the atmosphere), and zmanim can be off by up to 2 minutes based on atmospheric conditions. Inaccuracy is increased by elevation. It is not the intent of this API to provide any guarantee of accuracy. See Using a Digital Terrain Model to Calculate Visual Sunrise and Sunset Times for additional information on the subject.
How to Use the API
Information on how to use the API can be found on the How to Use the API page as well as by reading the JavaDocs
Zmanim Calendar Generator
A sample use of the API can be seen in the calendar generator. This uses the Zmanim API to generate an annual Zmanim calendar in an Excel spreadsheet. Since this is a demo of the API, the calendar is generated using All (about 102 currently) possible zmanim that the API can generate.
List of Zmanim Supported by the API
The API currently can generate about 122 different zmanim. Explanation of most of these can be seen by browsing the JavaDocs. You can link to the documentation of the specific zmanim from the links below.
- Alos 120
- Alos 120 Zmanis
- Alos 26º
- Alos 96
- Alos 96 Zmanis
- Alos 19.8º
- Alos 90
- Alos 90 Zmanis
- Alos 18º
- Alos 16.1º
- Alos 72
- Alos 72 Zmanis
- Alos 60
- Misheyakir 10.2º
- Misheyakir 11º
- Misheyakir 11.5º
- Sunrise
- Sea Level Sunrise
- Sof Zman Shma GRA
- Sof Zman Shma MGA 120
- Sof Zman Shma MGA 16.1º
- Sof Zman Shma MGA 18º
- Sof Zman Shma MGA 19.8º
- Sof Zman Shma MGA 72
- Sof Zman Shma MGA 72 Zmanis
- Sof Zman Shma MGA 90
- Sof Zman Shma MGA 90 Zmanis
- Sof Zman Shma MGA 96
- Sof Zman Shma MGA 96 Zmanis
- Sof Zman Shma MGA Alos to Sunset
- Sof Zman Shma MGA Alos to Tzais Geonim
- Sof Zman Shma 3 Hours Before Chatzos
- Sof Zman Shma 3 Hours Before Fixed Local Chatzos
Sof Zman Shma Kol Eliyahu- Sof Zman Shma Ateret Torah
- Sof Zman Tfila GRA
- Sof Zman Tfila MGA 120
- Sof Zman Tfila MGA 16.1º
- Sof Zman Tfila MGA 18º
- Sof Zman Tfila MGA 19.8º
- Sof Zman Tfila MGA 72
- Sof Zman Tfila MGA 72 Zmanis
- Sof Zman Tfila MGA 90
- Sof Zman Tfila MGA 90 Zmanis
- Sof Zman Tfila MGA 96
- Sof Zman Tfila MGA 96 Zmanis
- Sof Zman Tfila 2 Hours Before Chatzos
- Sof Zman Tfila 2 Hours Before Fixed Local Chatzos
- Sof Zman Tfila Ateret Torah
- Chatzos
- Fixed Local Chatzos
- Mincha Gedola GRA
- Mincha Gedola 72
- Mincha Gedola 16.1º
- Mincha Gedola Ateret Torah
- Mincha Gedola Lechumra 30 Minutes
- Mincha Ketana GRA
- Mincha Ketana 16.1º
- Mincha Ketana 72
- Mincha Ketana Ateret Torah
- Plag GRA
- Plag 60
- Plag 72
- Plag 72 Zmanis
- Plag 90
- Plag 90 Zmanis
- Plag 96
- Plag 96 Zmanis
- Plag 120
- Plag 120 Zmanis
- Plag 16.1º
- Plag 18º
- Plag 19.8º
- Plag 26º
- Plag Alos to Sunset
- Plag Alos to Tzais Geonim
- Plag Ateret Torah
- Candle Lighting
- Sea Level Sunset
- Sunset
- Bain Hashmashos Rabainu Tam 13.5 Minutes Before Tzais 7.083
- Bain Hashmashos Rabainu Tam 58.5 Minutes
- Bain Hashmashos Rabainu Tam 13.24º
- Bain Hashmashos Rabainu Tam 2 Stars
- Tzais Geonim 3.65º
- Tzais Geonim 4.37º
- Tzais Geonim 4.61º
- Tzais Geonim 4.8º
- Tzais Geonim 4.88º
- Tzais Geonim 5.95º
- Tzais Geonim 7.083º
- Tzais Geonim 8.5º
- Tzais 72
- Tzais 72 Zmanis
- Tzais 16.1º
- Tzais 90
- Tzais 90 Zmanis
- Tzais 18º
- Tzais 19.8º
- Tzais 96
- Tzais 96 Zmanis
- Tzais 26º
- Tzais 120
- Tzais 120 Zmanis
- Shaah Zmanis GRA
- Shaah Zmanis 72 Minutes
- Shaah Zmanis 72 Minutes Zmanis
- Shaah Zmanis 16.1º
- Shaah Zmanis 90 Minutes
- Shaah Zmanis 90 Minutes Zmanis
- Shaah Zmanis 18º
- Shaah Zmanis 19.8º
- Shaah Zmanis 96 Minutes
- Shaah Zmanis 96 Zmanis
- Shaah Zmanis 26º
- Shaah Zmanis 120 Minutes
- Shaah Zmanis 120 Zmanis
- Shaah Zmanis Ateret Torah
- Tchilas Zman Kidush Levana 3 Days (beta)
- Tchilas Zman Kidush Levana 7 Days (beta)
- Sof Zman Kidush Levana Between Moldos (beta)
- Sof Zman Kidush Levana 15 Days (beta)
Shalom,
I am curious if you’re aware of or compared your calculations to those used in kaluach. (www.kaluach.org). Yisroel also publishes some APIs via his site.
I am not asking out of idle curiosity but have an interest in knowing whether there are differences. I am not sure what offsets he uses for refraction nor which sunrise sunset calculation he uses. I know that he currently uses 0 elevation.
Shabbat Shalom,
(Rabbi) Shmuel Weisberg
Rabbi Weisberg,
I just took a look at the Kaluach JavaScript code (the Windows API is in a DLL/COM object without the sourcecode available to me). From the Javascript source it is clear that the code is based on the USNO algorithm. The offset to the 90° below the zenith used by their code for sunrise/set uses a combined 50′ (minutes of a degree = 50/60 or .83333) for refraction and solar radius. This is pretty much the standard used, where the solar radius is 16′ and the refraction average is 34′. They use the following offsets for zmanim.
Alos: 106°
Misheyakir: 101°
Tzais: 96°
Please let me know if you have any additional questions, though you are probably better off asking them.
Our shul is interested in featuring a display which among other things displays the countdown to the end of certain zmanim, such as
Countdown latest lime for:
Shema, Amida, Birkat Halevana, etc.
Since our shul has a great many late minyanim in the morning and continuous minyanim for Minha/Arvit, there is a great need for the people to know when these times occur.
We anticipate using LCD screens connected to a PC which will run the countdown clock among other messages (reminders for yaaleh v’yavo, hamelech hakadosh, etc.
Would you know anyone who would be able to help us with the programming of such an app?
Hey Jack, I don’t know if you have anything yet, but feel free to contact me. I may know of something.
Moshe,
Can you please contact me about the same item?
We would like to get a Luach that has the Zmanim and “Davening Info” on it.
Thanks….
Jerry
ffjerry AT gmail . c o m
Pingback: KosherJava » Plans for a Zmanim API FAQ
Were there any efforts to port KosherJava API to C++?
Thanks.
Bahaltener,
while porting should not be complex, I am unaware of effort to port it to C++ at the moment. The only complex part would be the portions of the code that use the Java Timezone and GergorianCalendar classes.
It would be interesting to port it to C++. I’ll take a look at the code. boost date_time API: http://www.boost.org/doc/libs/1_41_0/doc/html/date_time.html provides a useful set of calendar operations. May be it can be utilized to cover what KosherJava is using from Timezone and GregorianCalendar classes.
You may want to touch base with Moshe Wagner who used the Java Zmanim API in the Qt C++ based Luach. I posted details in the ZmanimCLI (Command Line Interface) post. Though he did not do a direct port, he would likely be interested. I would be happy to host any port.
On a side note. Why did you use GPL specifically for your API? Since it is a library, would it be better to release it under LGPL or other more permissive license?
For example, let’s say there is a port of KosherJava to other language. I assume, since the original is under GPL (2 or higher) the port will be also under GPL2(+). GPL library can only be used in GPL (or compatible) licensed code I believe. Therefore not only closed source projects, but even open source ones which use GPL incompatible licenses (let’s say MPL, CDDL, EPL, etc.) will not be able to be linked with the library. (That’s why in general, libraries are released under more permissive licenses, like LGPL, FreeBSD, X11 etc.).
Any thoughts on licensing?
Sorry for the delay in responding. There are two reasons that the code was released under the GPL and not the LGPL. The first one is that the oldest calculation engine used by the API, the ZmanimCalculator class, my modification of Ken Bloom’s code was released by him under the GPL. At this point, since I have another class, the SunTimesCalculator that returns the identical output and is not restricted to the GPL, this is no longer an issue, as long as this class is not included. The second one is that ideally, I would like people to release the entire app source, and thus the GPL, but I have as the code owner made some exceptions and in a few cases released the API to some developers under a non-transferable LGPL license. I would certainly allow the release of the C++ port to be released under the LGPL, and will consider a license change to the LGPL for the Java API in the future.
A sheynem dank!
I’ll start porting KosherJava API to C++ sometime soon I hope.
Any updates?
Pingback: KosherJava » KosherJava Zmanim API Released Under the LGPL License
Montreal canada why its says dawn 00:46? And all the zmanim are too early?
Shaul,
Thanks for contacting me. Are you using the API to generate these zmanim? Have a look at the Zmanim Map for Montreal where you will see accurate zmanim. If you are using the API, please share your code with me via the contact page so that I can try to help you debug it.
Hi, i’m traveling from Ben Gurion to Toronto on Motzei Shabbos/Sunday morning, as I can’t find an in-flight zmanim calculator. Can anyone help me with this?
Raphi,
Have a look at the Chai Tables. Click on the “Online Tables…” link. The front page of this site links to the Chai Tables.
Htzlacha.
The Zmanim calendar that is available for download is very useful, but I would like to request some modifications:
1. Please show the Hebrew date and Chaggim in English characters
2. Please include fast days as a “Chag”. There are some complications that a fast cannot start on a Saturday night, so it would be helpful if the system made this calculation as part of its output.
Bernard,
As far as the Zmanim Calendar,
Pingback: AstronomicalCalendar has a problem with half hour timezones. » Moishe Beshkin