Zmanim Q & A Forum

Zmanim QuestionsFrom time to time users of this site contact me with zmanim related questions, both technical and halachic. While I do not mind answering these questions, an open forum is probably more helpful to a greater audience. Please feel free to post your zmanim questions and comment here. While the target of this API were Java programmers, the vast majority of questions/comments are not related to the actual API. Here are some recent questions received (made generic).

  • Q: Can you let me know what calculations/opinion is used by the zmanim shown at [link removed]? I tried contacting the owner of the site but no one replied.
    A: I was able to answer the user based on information on the site and comparing the zmanim
  • Q: What opinion does zman XYZ follow?
    A: The information can be seen in the Javadocs, and I added additional information in the email to the user.
  • Q: How can I use your API in JavaScipt/Ruby/PHP/C#/C++/Obj-C etc, etc
    A: The API is written in Java. The Zmanim API was already ported to .NET (Zmanim.NET) and Objective-C (KosherCocoa). If you are looking for it in different programming languages, a port is likely needed. I am more than willing to help guide you and make changes to my API to allow easier porting, but this is not something that I have the time to do myself.
  • Q: Your zmanim spreadsheet does not show a time for tzais as X minutes after shkiah etc
    A: In some of these cases I actually added zmanim to the API, but for the less commonly used times, I point the questioner to the API with a sample on how to generate the requested zman. The API is very flexible, and almost every zman pointed out to me was very easy to generate
  • Q: Why are your zmanim 2 minutes different than [link removed].
    A It is not always clear what exact coordinate was used to generate those zmanim or what rounding was done by the author. If you provide more detailed information (usually by contacting the author of that calendar) you will usually find that the 2 can be matched
  • Q: I want to incorporate a Luach on my site, can you help?
    A: while the current version of the API only calculates Zmanim, the beta version has Luach support. Zmanim are based on a solar year, and there is no need for the Hebrew date for the calculations of zmanim (with the exception of kiddush levana times). That said, Avrom Finkelstien released a java API for a Luach in 2002 (a cache is available via the The Wayback Machine) under the GPL. I modified the code and integrated it into the beta version of the Zmanim API. There is another API available from the ICU Project released under the open source ICU License by IBM. There are various other ones including the non-GPL Gauss library released by Zvi Har’El.
  • Q: I found the following bug in the API!!!
    A: I welcome these reports even though the majority are not bugs at all

31 thoughts on “Zmanim Q & A Forum

  1. zohar

    Hi ,
    Thanks for sharing ,
    I am trying to find an example for using the Zman Class ,
    I wish to send a date and get it in Hebrew format .

    I am trying to as fllow :

    Date d1 = new Date();
    Zman _zman =new Zman(d1,”MyNewTime”); (what the label an the zman constructor use for?)

    _zman.setZman(d1) ;

    then here i want to display my new Hebrew date ,
    can i do that with the zman class ?

    Thanks Zohar

    Reply
      1. KosherJava Post author

        There is documentation for this in the base AstronomicalCalendar class. ZmanimCalendar and ComplexZmanimCalendar should behave the same way.

        // To get the time of sunrise, first set the date.
        // If not set, the date will default to today.
        AstronomicalCalendar ac = new AstronomicalCalendar(location);
        ac.getCalendar().set(Calendar.MONTH, Calendar.FEBRUARY);
        ac.getCalendar().set(Calendar.DAY_OF_MONTH, 8);
        Date sunrise = ac.getSunrise();
        
        Reply
  2. Dave

    Please look at this site. zmanim is a bottom of page but the zmanim is not showing

    Luach for Ohev Tzedek-Shaarei Torah
    4 Shevat 5771
    ד’ שבט תשע”א

    Zmanim
    Alos HaShachar:
    Netz:
    Earliest Tallis:
    Latest Sh’ma:
    Chatzos:
    Mincha Gedola:
    Mincha Ktana:
    Plag Hamincha:
    Shkiah:
    Hide
    Shabbos

    It will come in 6 days.
    Candle light :
    Shabbos ends:

    do i need to configure something else?
    Thank you,
    Dave

    Reply
    1. KosherJava Post author

      Charles,
      Thanks for your interst. This site is targeted mostly at software developers interested in using zmanim in their programs. That said, there are 2 very easy to use ways to get the zmanim you require

      • The Zmanim Map. This is a quick way to get the zmanim for the current day on a map
      • Zmanim Calendar Generator. This will generate a spreadsheet with zmanim for the entire year. You will also find a link to this on the bottom of the zmanim list in the Zmanim Map

      Please let me know if there is anything specific that you are looking for.

      Reply
      1. Charles

        you wrote “Zmanim Calendar Generator. This will generate a spreadsheet with zmanim for the entire year. You will also find a link to this on the bottom of the zmanim list in the Zmanim Map” I tries clicking on “Zmanim Calendar Generator” and the link was dead.
        Thanks

        Reply
  3. Samit

    Hy,

    can you please tell me any function in this api to check its holiday in jewish calendar for specific date …

    i need to list of all holidays list of jewish calendar , list of days of Rosh Chodesh holidays , and Omer holidays number.. i checked in libhdate provide all functions , but i not found these all functions or functionality in this api.. can you please inform me below all functions are available in java api or not ?

    i need below all functions functionality…

    - get_holyday_type() — the holiday type
    - get_omer_day() — get the day of the omer
    - get_holyday_string() — string of hebrew holiday name
    - get_holyday() — the hebrew holiday number

    any other suggestion welcome.

    Thanks

    Reply
      1. Samit

        Thanks for your quickly reply..

        i checked net.sourceforge.zmanim.hebrewcalendar package but not found specific function which i mentioned my above post..

        can you give me some description or some suggestion for how to check specific date is current holiday or not and if holiday then i need to holiday name.. i checked hebrewcalendar package but not found or not understand which function i use so please any suggestion..

        Thanks

        Reply
        1. KosherJava Post author

          Samit,
          Here is some sample code. I am afraid that I can’t offer any additional help at this point. The code below should have been pretty clear from the JavaDocs.

          JewishCalendar jd = new JewishCalendar(); //current date
          HebrewDateFormatter hdf = new HebrewDateFormatter();
          System.out.println(jd); //prints hebrew date in English chars - 24 Teves, 5772
          System.out.println(jd.getDayOfOmer()); //-1 since there is no omer count this time of year
          System.out.println(hdf.formatYomTov(jd)); //nothing printed since it is not a holiday
          jd.setJewishDate(5772, JewishDate.NISSAN, 18); //change date to one that is a holiday and has an Omer count
          System.out.println(jd.getDayOfOmer()); //3rd day of omer
          System.out.println(hdf.formatOmer(jd));
          System.out.println(hdf.formatYomTov(jd)); //Chol Hamoed Pesach
          hdf.setHebrewFormat(true); //change formatting to Hebrew
          System.out.println(hdf.format(jd)); //date formatted in Hebrew
          System.out.println(hdf.formatOmer(jd)); //3rd day of Omer in Hebrew
          System.out.println(hdf.formatYomTov(jd)); //Chol Hamoed Pesach in Hebrew
          
          Reply
  4. Samit

    Hello KosherJava ,

    Again Thanks for earlier helps…

    can you please solve my questions regarding api.

    i need to jewish holiday list of year , when i passed year then return all holiday names and dates.

    i implemented this way : pass date and check its holiday but this way i pass all days of year and get response of api is holiday its takes more time to check whole year.

    so any function in api which return all jewish holidays name and dates when i passed year in function.

    Please tell me any another way to get all holidays list and dates of year quickly.

    Thanks

    Reply
  5. Benjy Gilbert

    Hi there,

    I’m getting an app built to show the time in shaot zmaniot and allow users to set alarms and reminders based on the zmanim (e.g. x mins before 4:00 Daytime for shacharit).

    As part of the app, we’ll be adding some notifications on dates in the jewish calendar, and would love to add the 5 d’rabanan fast days along with a reminder the day before (or that morning) that it’s a fast day.

    Are there any plans to add fast days to the hebrew calendar part of the app? It’s non-trivial to add ourselves what with the various halachot of bringing forward/pushing back when they fall no shabbat (like this year), so hoping there’s a pre-coded add on available for it.

    Thanks!
    Benjy

    Reply
  6. Bernard Seeff

    The link that you showed me is only for mobile phones and I would like either a spreadsheet or a program that can output to a spreadsheet. The Zmanim calendar is very comprehensive but I would like to have an offline version and also, something that shows fast days, as these can vary according to the day of the week.

    Reply
  7. David Kunkel

    Is anyone else having a problem with sunrise and sunset times on the 2013 zemanim spreadsheet? I generated the spreadsheet using my synagogue’s Google Maps location data–same as last year–and all the times are correct EXCEPT sunrise and sunset, which are three minutes (or perhaps three days) off when compared to 2012 and when compared to other reference material. Is this an algorithm or data input issue??

    Reply
    1. KosherJava Post author

      David,
      Thank you very much for pointing this out to me. The problem in the Zmanim Calendar is now resolved (though you will see from my explanation below that it was not a real issue). Last year when you set your location you did not set the elevation, so the calendar calculated it for sea level. This year, with Google Map integration, I automated the elevation look-up. The calendar always used elevation adjusted sunrise and sunset for the “standard” calendar, and both elevation adjusted and sea level for the “full” version, however, most people did not look up the elevation in the past, so sea level times were usually returned. Your location (as disclosed in an email) has an elevation of 186 meters above sea level, and this results in an almost 3 minute difference VS sea level. Calculated for January 7 for your location:
      Sunrise (186 meters): 7:43:57 AM
      Sunrise (Sea Level): 7:46:45 AM

      Since people using the standard calendar probably do not expect the elevation adjusted sunrise and set (although it is not wrong), and since most other calendars do not use elevation adjustment, I changed the calendar to now show sea level sunrise in the standard calendar. Ask your Rabbi about sea level VS elevation adjusted. You may want to see the following posts on elevation.

        Reply
        1. David Kunkel

          Thanks for the clear explanation! I did check with my Rav and for our particular area/circumstance we decided to use sea level for Erev Shabbos as it is used by all the other Shuls in our area and because it’s earlier than true sunset–which benefits last-minute rushers like myself. This also means that to be machmir on Motzei Shabbos we should not be too hasty to end Shabbos (especially for those who hold the earliest zman) to avoid any issues. Of course if someone is below sea level the ruling might be quite different and a Rav should be consulted.

          –David

          Reply

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>