<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>KosherJava &#187; FAQ</title>
	<atom:link href="http://www.kosherjava.com/tag/faq/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kosherjava.com</link>
	<description>A weblog about Zmanim, Kosher Coffee (Kosher Java) and other odds &#38; ends</description>
	<lastBuildDate>Fri, 06 Jan 2012 18:28:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>FAQ: Outputting Zmanim for A Different Time Zone With the the Zmanim API</title>
		<link>http://www.kosherjava.com/2011/11/08/outputting-zmanim-for-a-different-time-zone-with-the-the-zmanim-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=outputting-zmanim-for-a-different-time-zone-with-the-the-zmanim-api</link>
		<comments>http://www.kosherjava.com/2011/11/08/outputting-zmanim-for-a-different-time-zone-with-the-the-zmanim-api/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 05:01:03 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Bugs]]></category>
		<category><![CDATA[Timezone]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=1349</guid>
		<description><![CDATA[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&#8217;s time zone may return output that appears incorrect. For example a user in Lakewood, NJ trying to calculate sunrise [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/coffeeQuestion.jpg" alt="Zmanim API FAQ"/><h2>Question:</h2>Why does the output of zmanim for a different time zone appear incorrect?<h2>Answer:</h2>
One of the common issues encountered by developers using the API is that zmanim generated for a different time zone than the user&#8217;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:

<pre class="brush: java; title: ; notranslate">
String locationName = &quot;Jerusalem&quot;;
double latitude = 31.778; // Har habayis
double longitude = 35.2354;// Har Habayis
double elevation = 0;
TimeZone timeZone = TimeZone.getTimeZone(&quot;Asia/Jerusalem&quot;);
GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone);
ZmanimCalendar zc = new ZmanimCalendar(location);
zc.getCalendar().set(2011, Calendar.FEBRUARY, 8);
System.out.println(&quot;Sunrise: &quot; + zc.getSunrise());
System.out.println(&quot;Sunset: &quot; + zc.getSunset());
</pre>

While you would expect a <a href="http://www.kosherjava.com/maps/zmanim.html?lat=31.778&#038;lng=35.2354&#038;zoom=19&#038;date=2011-2-8">sunrise of 6:27:41 AM and sunset of 5:19:19 PM</a>, 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:
<pre class="brush: plain; title: ; notranslate">
Sunrise: Mon Feb 07 23:27:41 EST 2011
Sunset: Tue Feb 08 10:19:19 EST 2011
</pre>

The issue is simple, and the sunrise and sunset returned above are actually accurate. Zmanim are returned by the Zmanim API as a Java <a href="http://download.oracle.com/javase/7/docs/api/java/util/Date.html">Date object</a> that represents a moment in time (stored internally by Java as <a href="http://en.wikipedia.org/wiki/Unix_time">Unix Time</a> &#8211; 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 <b>EST</b>. Java is simply outputting the <a href="http://download.oracle.com/javase/7/docs/api/java/util/Date.html#toString%28%29">Date as a String</a> formatted to the users default time zone (EST in this example). The user probably intends to output the time in IST &#8211; Israel Standard Time (&#8220;Asia/Jerusalem&#8221; in the Olson database). To do this you have to output the zmanim using a formatter set to use the &#8220;Asia/Jerusalem&#8221; time zone.

<pre class="brush: java; title: ; notranslate">
DateFormat zmanimFormat = new SimpleDateFormat(&quot;EEE MMM dd HH:mm:ss z yyyy&quot;);
zmanimFormat.setTimeZone(location.getTimeZone());

System.out.println(&quot;sunrise: &quot; + zmanimFormat.format(zc.getSunrise()));
System.out.println(&quot;sunset:&quot; + zmanimFormat.format(zc.getSunset()));
</pre>
will output the expected
<pre class="brush: plain; title: ; notranslate">
sunrise: Tue Feb 08 06:27:41 IST 2011
sunset:Tue Feb 08 17:19:19 IST 2011
</pre>

Below is the full code example. 

<pre class="brush: java; highlight: [16,17,18,19]; title: ; notranslate">
import net.sourceforge.zmanim.*;
import net.sourceforge.zmanim.util.*;
import java.util.TimeZone;
public class FormatZmanim{
	public static void main(String [] args) {
		String locationName = &quot;Jerusalem&quot;;
		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(&quot;Asia/Jerusalem&quot;);
		//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(&quot;EEE MMM dd HH:mm:ss z yyyy&quot;); //Create the formatter
		zmanimFormat.setTimeZone(location.getTimeZone()); //set the formatter's time zone
		System.out.println(&quot;sunrise: &quot; + zmanimFormat.format(zc.getSunrise()));
		System.out.println(&quot;sunset:&quot; + zmanimFormat.format(zc.getSunset()));
	}
}
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2011/11/08/outputting-zmanim-for-a-different-time-zone-with-the-the-zmanim-api/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>FAQ: How do I Calculate the Jewish/Hebrew Date for &#8230;?</title>
		<link>http://www.kosherjava.com/2011/02/23/faq-how-do-i-calculate-the-jewish-hebrew-date-for/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=faq-how-do-i-calculate-the-jewish-hebrew-date-for</link>
		<comments>http://www.kosherjava.com/2011/02/23/faq-how-do-i-calculate-the-jewish-hebrew-date-for/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 05:14:16 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Hebrew Date]]></category>
		<category><![CDATA[Jewish Calendar]]></category>
		<category><![CDATA[Jewish date]]></category>
		<category><![CDATA[Zmanim Accuracy]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=266</guid>
		<description><![CDATA[Question:How do I get the Jewish Date for &#8230; using the Zmanim API? Answer:The current version of the Zanim API does not support Jewish calendrical calculations. Zmanim are almost exclusively based on the solar calendar, so for example, the sunrise on February 8th this year in Montreal (or any other date and location), will be [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/calendarJava.png" alt="Java Calendar"/><h2>Question:</h2>How do I get the Jewish Date for &#8230; using the <a href="http://www.kosherjava.com/zmanim-project/">Zmanim API</a>?
<h2>Answer:</h2>The <a href="http://www.kosherjava.com/zmanim-project/downloads/">current version</a> of the Zanim API does not support <a href="http://en.wikipedia.org/wiki/Hebrew_calendar">Jewish calendrical</a> calculations. Zmanim are almost exclusively based on the <a href="http://en.wikipedia.org/wiki/Solar_calendar">solar calendar</a>, so for example, the sunrise on February 8th this year in <a href="http://en.wikipedia.org/wiki/Montreal">Montreal</a> (or any other date and location), will be almost the same every year. for this reason there was little point (as far as zmanim) to support Jewish date calculations in the API.  One of the only zmanim to rely on a Jewish date is the sof zman <a href="http://en.wikipedia.org/wiki/Kiddush_Levana">kidush levanah</a> calculation, though there are some opinions that it is purely <a href="http://en.wikipedia.org/wiki/Molad">molad</a> based, and this can be calculated without a Jewish calendar component to the API. This zman is obviously not currently implemented in the Zmanim API. I am currently working on adding Jewish date support to the API. The code is based off <a href="http://www.facebook.com/avromf">Avrom Finkelstein</a>&#8216;s no longer active <a href="http://web.archive.org/web/20061207174551/http://www.bayt.org/calendar/hebdate.html">HebrewDate project</a>. I refactored a lot of the code and fixed a number of bugs. Anyone interested in alpha testing this code can download the <a href="https://code.google.com/p/kosherjava/">latest Zmanim SVN code</a> (or download the <a href="http://kosherjava.googlecode.com/files/zmanim-1.3.0alpha3.zip">Zmanim API 1.3.0 alpha </a> release).
I mentioned that it &#8220;will be almost the same every year&#8221; and this is due the the approximate 1/4 day drift between the 356 day calendar year and the approximately 365.25 days actually present in the <a href="http://en.wikipedia.org/wiki/Astronomical_year">astronomical year</a>, a discrepancy corrected every <a href="http://en.wikipedia.org/wiki/Leap_year">leap year</a>. A future FAQ (probably a few of them) may delve specifically into this drift as well as general zmanim accuracy issues in detail. 
If you are simply looking to convert a Hebrew date to Gregorian or Gregorian to Hebrew online without the API, try the <a href="http://www.jewishgen.org">JewishGen</a> <a href="http://www.jewishgen.org/JOS/josdates.htm">calendar conversion tools</a>.]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2011/02/23/faq-how-do-i-calculate-the-jewish-hebrew-date-for/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>FAQ: Why Some Zmanim Never Occur (Developers Beware)</title>
		<link>http://www.kosherjava.com/2010/06/02/faq-why-some-zmanim-never-occur-developers-beware/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=faq-why-some-zmanim-never-occur-developers-beware</link>
		<comments>http://www.kosherjava.com/2010/06/02/faq-why-some-zmanim-never-occur-developers-beware/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 02:30:11 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Arctic Circle]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Latitude and Longitude]]></category>
		<category><![CDATA[null]]></category>
		<category><![CDATA[Software Bugs]]></category>
		<category><![CDATA[Twilight]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=671</guid>
		<description><![CDATA[Question:Why do Some Zmanim Never Occur in Some Locations? (Developers Beware) Answer:While most people realize that the sun may not rise or set in the Arctic and Antarctic Circles (see the Star-K&#8217;s When Does One Pray When There Is No Day), many are not aware that some twilight dips will not occur during part of [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/EnglandTwilightMap.png" alt="England Twilight Map" title="England Twilight Map" /><h2>Question:</h2>Why do Some Zmanim Never Occur in Some Locations? (Developers Beware)
<h2>Answer:</h2>While most people realize that the sun may not rise or set in the <a href="http://en.wikipedia.org/wiki/Arctic_Circle">Arctic</a> and <a href="http://en.wikipedia.org/wiki/Antarctic_Circle">Antarctic</a> Circles (see the Star-K&#8217;s <a href="http://www.star-k.org/kashrus/kk-whendoesonepraywhenthereisnoday.htm">When Does One Pray When There Is No Day</a>),  many are not aware that some twilight dips will not occur during part of the year as far south of the Arctic Circle as London. For example around the <a href="http://en.wikipedia.org/wiki/Summer_solstice">summer solstice</a> in <a href="http://www.kosherjava.com/maps/zmanim2.html?lat=51.5&#038;lng=-0.10&#038;zoom=6&#038;date=2010-06-21">London (on the zmanim map)</a> the sun will never dip far enough below the horizon to reach <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/ComplexZmanimCalendar.html#getAlos16Point1Degrees%28%29">Alos 16°</a>. This happens in London from June 5<sup>th</sup> till July 8<sup>th</sup>. The image seen on the top right (original at <a href="http://www.timeanddate.com/worldclock/sunearth.html?n=136&#038;month=6&#038;day=21&#038;year=2010&#038;hour=0&#038;min=28&#038;sec=0">timeanddate.com</a>) shows various <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/AstronomicalCalendar.html#getBeginAstronomicalTwilight%28%29">civil twilights</a> centered on London on Midnight June 21<sup>st</sup>. Look carefully to see the various bands of twilight. Gateshead will not have Alos 16° from May 16<sup>th</sup> through July 28<sup>th</sup>, while <a href="http://www.kosherjava.com/maps/zmanim2.html?lat=61.189412&#038;lng=-149.86042&#038;zoom=17&#038;date=2010-08-21">Anchorage, Alaska</a> (yes there is a <a href="http://lubavitch.com/centers/detail.html?id=389">Frum Shul in Anchorage</a> with an interesting davening direction issue that is discussed in the <a href="http://www.kosherjava.com/2011/01/17/davening-direction-from-alaska/">Davening Direction from Alaska</a> post ) will not have Alos 16.1° from April 25<sup>th</sup> to August 20<sup>th</sup>. Zmanim based on sunrise such as <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/ZmanimCalendar.html#getAlos72%28%29">Also 72</a> that is a 72 minute offset of sunrise can be calculated as long as sunrise can be calculated, something that will happen as long as you are not in the Arctic or Antarctic Circles.
For this reason, the Zmanim API will return a <a href="http://en.wikipedia.org/wiki/Pointer_%28computing%29#Null_pointer">null</a> when a zman will not happen. A <a href="http://java.sun.com/javase/6/docs/api/java/lang/Long.html#MIN_VALUE">Long.MIN_VALUE</a> will be returned when a <a href="http://en.wikipedia.org/wiki/Long_integer">long</a> is expected such as in the case of a Shaah Zmanis. While an inconvenience to developers who have to code for this, the alternative of a default date would mean that developers unaware of this would return incorrect zmanim, something far worse than a program error from a <a href="http://java.sun.com/javase/7/docs/api/java/lang/NullPointerException.html">NullPointerException</a>.
In recent weeks two publicly available programs using the Zmanim API ran into issues due to nulls returned for early alos times. Being something not anticipated by the developers, the nulls generated errors in the programs that quickly led to fixes.  For this reason Yitzchok updated the <a href="http://github.com/Yitzchok/Zmanim/">Zmanim .NET project</a> to return the nullable <em>DateTime?</em> instead of the regular DateTime that it had previously been returning. While the <a href="http://www.kosherjava.com/zmanim/docs/api/">Zmanim API documentation</a> always made the possibility of a null being returned possible, I modified the documentation to make this clear on the return value documentation for every zman. Code with the modified documentation was part of the recently released Zmanim API 1.2.1.]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2010/06/02/faq-why-some-zmanim-never-occur-developers-beware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FAQ: How Much Earlier is Sunrise on Mount Everest Due to Elevation?</title>
		<link>http://www.kosherjava.com/2010/03/07/faq-how-much-earlier-is-sunrise-on-mount-everest-due-to-elevation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=faq-how-much-earlier-is-sunrise-on-mount-everest-due-to-elevation</link>
		<comments>http://www.kosherjava.com/2010/03/07/faq-how-much-earlier-is-sunrise-on-mount-everest-due-to-elevation/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 01:57:16 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Elevation]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[Sea level]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=427</guid>
		<description><![CDATA[Question:How Much Earlier is Sunrise on Mount Everest Due to Elevation?Answer:The greatest sunrise and sunset elevation effect on Earth is on Mount Everest (at 27.988056 N, 86.925278 E as seen on the Direction to Yerushalayim Map). With an elevation of 8,848 Meters (29, 029 feet), sunrise would be up to 15 minutes and 31 seconds [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/SunriseEverest.jpg" alt="Sunrise over Everest" title="Sunrise over Everest" /><h2>Question:</h2>How Much Earlier is Sunrise on Mount Everest Due to Elevation?<h2>Answer:</h2>The greatest sunrise and sunset elevation effect on Earth is on Mount Everest (at 27.988056 N, 86.925278 E as seen on the <a href="http://www.kosherjava.com/maps/zmanim.html?lat=27.988056&amp;lng=86.925278&amp;zoom=15&amp;type=p">Direction to Yerushalayim Map</a>). With an elevation of 8,848 Meters (29, 029 feet), sunrise would be up to 15 minutes and 31 seconds earlier on Mount Everest than on sea level. The range of the effect is from 15 minutes and 31 seconds on June 22nd, to a &#8220;low&#8221; of 13 minutes 41 seconds earlier on March 18th. Being in a large mountain range with obstructed horizons, it is likely never actually seen that early. In addition to questions about mountains, every few months I get asked about how much earlier sunrise/set can be seen in skyscrapers. There are various halacha questions as to whether this actually affects zmanim that I will mention later. Here are some raw numbers. <img class="alignright" src="/images/BurjKhalifa.jpg" alt="Burj Khalifa" title="Burj Khalifa" /><a href="http://en.wikipedia.org/wiki/Burj_Khalifa">Burj Khalifa</a> (at 25.197222 N, 55.274056 E as seen on the <a href="http://www.kosherjava.com/maps/zmanim.html?lat=25.197222&amp;lng=55.274056&amp;zoom=15">Direction to Yerushalayim Map</a>) is the tallest building in the world. With a height of 828 m (2,717 ft), visible sunrise to someone standing on top of the crown (something unrealistic) on June 22nd would be at 5:24:56 AM versus 5:29:31 AM on sea level, a difference of 4 minutes and 35 seconds. Sunset would be 7:16:35 PM versus 7:12:00 PM at sea level, a difference of 4 minutes and 35 seconds. A more realistic scenario would be the visibility sunrise on the highest floor (the 160th) , an elevation of 672 m at 5:25:23 AM, a difference of 4 minutes and 8 seconds earlier than sea level. Sunset on the 160th floor would be 7:16:08 PM, or 4 minutes and 8 seconds later than at sea level.
As far as the halacha being affected by the elevation of buildings, the Baal Hatanya seems to indicate that tall buildings would make sunset later. See Yisroel vehazmanim ישראל והזמנים Vol II, page 910. In the Shraga Lachaim שרגא לחיים footnotes Rabbi Harfenes states that <blockquote dir="rtl">ויש להוסיף שהו דבר תמוה לומר דעד שלא נבנו הבנינים הגבוהים היה זמן שבת התלוי בשקעה&#8221;ח (שקיעה ראשונה להגאנים ושקיעה שניה לר&#8221;ת) מוקדם, ולאחר שנבנו יש לאחר הזמנים, ועד עכשיו שהיו בניו יארק הבנינים התאומיות (טווין טאוע&#8221;ר בלע&#8221;ז) שכל א&#8217; מהם היה בת ק&#8221;י קומות היה זמן השקיעה מאוחר, ועתה לאחר שהפילו והרסו אותם רשעים וזדים ארורים ימ&#8221;ש חזר הדבר לקדמותו להקדים זמן השקיעה.</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2010/03/07/faq-how-much-earlier-is-sunrise-on-mount-everest-due-to-elevation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FAQ: Where is the Zmanim API Main Method?</title>
		<link>http://www.kosherjava.com/2009/11/05/faq-where-is-the-main-method/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=faq-where-is-the-main-method</link>
		<comments>http://www.kosherjava.com/2009/11/05/faq-where-is-the-main-method/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 22:08:31 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=215</guid>
		<description><![CDATA[Question:Where is the main method? Answer:This is a more technical variant of the &#8220;How do I install the Zmanim API Program?&#8221;, but coming from someone who already knows that it is a Java program that can’t be installed, but assumes that it can be run. The main method is the entry point to a Java [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/coffeeQuestion.jpg" alt="Java FAQ"/><h2>Question:</h2>Where is the main method?
<h2>Answer:</h2>This is a more technical variant of the <a href="http://www.kosherjava.com/2009/11/05/faq-how-do-i-install-the-zmanim-api-program/">&#8220;How do I install the Zmanim API Program?&#8221;</a>, but coming from someone who already knows that it is a <a href="http://en.wikipedia.org/wiki/Java_%28programming_language%29">Java</a> program that can’t be installed, but assumes that it can be run. The <a href="http://en.wikipedia.org/wiki/Main_function#Java">main method</a> is the entry point to a Java program. Since this is a <a href="http://en.wikipedia.org/wiki/Library_%28computer_science%29">library/API</a> and not a program, it does not have a main method. The code to generate zmanim is spelled out in the <a href="http://www.kosherjava.com/zmanim-project/how-to-use-the-zmanim-api/">How to Use the Zmanim API page</a>. Below is a full example of a very simple zmanim program that outputs sunrise, sof zman krias shema and sunset for the current day in <a href="http://en.wikipedia.org/wiki/Lakewood_Township,_New_Jersey">Lakewood, NJ</a>. Please ensure that the Zmanim <a href="http://en.wikipedia.org/wiki/JAR_%28file_format%29">jar</a> (<a href="http://www.kosherjava.com/zmanim-project/downloads/">download</a>) is in your <a href="http://en.wikipedia.org/wiki/Classpath_%28Java%29">classpath</a>.
<pre class="brush: java; title: ; notranslate">
/**
 * This program is a simple demonstration of the kosherjava.com Zmanim API.
 * To compile, ensure that the Zmanim Jar is in your classpath.
 */
import net.sourceforge.zmanim.*;
import net.sourceforge.zmanim.util.*;
import java.util.TimeZone;
public class SimpleZmanim{
	public static void main(String [] args) {
		String locationName = &quot;Lakewood, NJ&quot;;
		double latitude = 40.096; //latitude of Lakewood, NJ
		double longitude = -74.222; //longitude of Lakewood, NJ
		double elevation = 0; //optional elevation
		//use a Valid Olson Database timezone listed in java.util.TimeZone.getAvailableIDs()
		TimeZone timeZone = TimeZone.getTimeZone(&quot;America/New_York&quot;);
		//create the location object
		GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone);
		//create the ZmanimCalendar
		ZmanimCalendar zc = new ZmanimCalendar(location);
		//optionally set the internal calendar. If not set it will default to the current date
		//zc.getCalendar().set(1969, Calendar.FEBRUARY, 8);
		System.out.println(&quot;Today's Zmanim for &quot; + locationName);
		System.out.println(&quot;Sunrise: &quot; + zc.getSunrise()); //output sunrise
		System.out.println(&quot;Sof Zman Shema GRA: &quot; + zc.getSofZmanShmaGRA()); //output Sof Zman Shema GRA
		System.out.println(&quot;Sunset: &quot; + zc.getSunset()); //output sunset
	}
}
</pre>

The following would <a href="http://en.wikipedia.org/wiki/Compiler">compile</a> and <a href="http://en.wikipedia.org/wiki/Execution_%28computing%29">execute</a> this code (sample from a <a href="http://en.wikipedia.org/wiki/COMMAND.COM">DOS prompt</a> in Windows).

<pre class="brush: plain; title: ; notranslate">
C:\path\to\code&gt;javac SimpleZmanim.java

C:\path\to\code&gt;java SimpleZmanim

Today's Zmanim for Lakewood, NJ
Sunrise: Thu Nov 05 06:30:27 EST 2009
Sof Zman Shema GRA: Thu Nov 05 09:05:21 EST 2009
Sunset: Thu Nov 05 16:50:02 EST 2009
</pre>

Please see the <a href="http://www.kosherjava.com/zmanim/docs/api/">Zmanim API documentation</a> for a more complete view of the API.]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2009/11/05/faq-where-is-the-main-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FAQ: How do I install the Zmanim API Program?</title>
		<link>http://www.kosherjava.com/2009/11/05/faq-how-do-i-install-the-zmanim-api-program/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=faq-how-do-i-install-the-zmanim-api-program</link>
		<comments>http://www.kosherjava.com/2009/11/05/faq-how-do-i-install-the-zmanim-api-program/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 21:42:49 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[FAQ]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=205</guid>
		<description><![CDATA[Question: How do I install the Zmanim API Program? Answer: The Zmanim API is not a program that can be installed, but a Java programming library often referred to as an API (Application Programming Interface). This is a building block to be used by programmers who want to easily include zmanim in their own programs. [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/coffeeQuestion.jpg" alt="Java FAQ"/><h2>Question:</h2>
How do I install the Zmanim API Program?
<h2>Answer:</h2> The <a href="http://www.kosherjava.com/zmanim-project/">Zmanim API</a> is not a program that can be installed, but a <a href="http://en.wikipedia.org/wiki/Java_%28programming_language%29">Java</a> <a href="http://en.wikipedia.org/wiki/Library_%28computer_science%29">programming library</a> often referred to as an <a href="http://en.wikipedia.org/wiki/Application_programming_interface">API (Application Programming Interface)</a>. This is a building block to be used by programmers who want to easily include zmanim in their own programs. The Zmanim API allows them to do this with minimal understanding of the way zmanim are calculated. A sample of a program that uses the Zmanim API library is the <a href="http://www.kosherjava.com/zmanim-project/zmanim-calendar-generator/">Zmanim Calendar Generator</a>. The Zmanim Calendar Generator collects user entered location information on the web page and submits this to a small Java program that calculates a year&#8217;s worth of zmanim and outputs it as an <a href="http://en.wikipedia.org/wiki/Microsoft_Excel">Excel spreadsheet</a> (using the <a href="http://en.wikipedia.org/wiki/Apache_POI">Apache POI</a> library). A future FAQ may provide a list of current programs that use the Zmanim API.
]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2009/11/05/faq-how-do-i-install-the-zmanim-api-program/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plans for a Zmanim API FAQ</title>
		<link>http://www.kosherjava.com/2009/11/05/plans-for-a-zmanim-api-faq/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=plans-for-a-zmanim-api-faq</link>
		<comments>http://www.kosherjava.com/2009/11/05/plans-for-a-zmanim-api-faq/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 21:19:56 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Site News]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[FAQ]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=199</guid>
		<description><![CDATA[Questions communicated to me via the contact page far exceed the number of comments in the blog. In the hope of clarifying the most common questions related to the Zmanim API and to a lesser degree other parts of this site, I plan on a series of FAQ posts that will hopefully cut down on [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/coffeeQuestion.jpg" alt="Java FAQ"/>Questions communicated to me via the <a href="http://www.kosherjava.com/contact/">contact page</a> far exceed the number of comments in the blog. In the hope of clarifying the most common questions related to the <a href="http://www.kosherjava.com/zmanim-project/">Zmanim API</a> and to a lesser degree other parts of this site, I plan on a series of FAQ posts that will hopefully cut down on the number of questions. The <a href="http://www.kosherjava.com/tag/faq/">list of FAQs</a> may eventually be consolidated into a FAQ page.]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2009/11/05/plans-for-a-zmanim-api-faq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

