FAQ: How Much Earlier is Sunrise on Mount Everest Due to Elevation?

Sunrise over Everest

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.988° N, 86.925° 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 earlier on Mount Everest than at sea level. The range of the effect is from 15 minutes and 31 seconds on June 22nd, to a “low” 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. Burj KhalifaBurj Khalifa (at 25.197° N, 55.274° E as seen on the Direction to Yerushalayim Map) 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 (2,204 ft) 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

ויש להוסיף שהוא דבר תמוה לומר דעד שלא נבנו הבנינים הגבוהים היה זמן שבת התלוי בשקעה”ח (שקיעה ראשונה להגאנים ושקיעה שניה לר”ת) מוקדם, ולאחר שנבנו יש לאחר הזמנים, ועד עכשיו שהיו בניו יארק הבנינים התאומויות (טווין-טאוע”ר בלע”ז) שכל א’ מהם היה בת ק”י קומות היה זמן השקיעה מאוחר, ועתה לאחר שהפילו והרסו אותם רשעים וזדים ארורים ימ”ש חזר הדבר לקדמותו להקדים זמן השקיעה.

Zmanim API 1.2 Released

The Zmanim API 1.2 was released today. The only change in this release is the removal of elevation as a factor in the calculation of all zmanim besides sunrise and sunset. Updated JavaDocs now reflect these changes. Please see the Elevation Now Only Impacts Sunrise and Sunset Calculations in the Zmanim API post for additional information.

I would like to thank the various people who contacted me on the subject.

The main download is the Zmanim 1.2 release zip file that includes source files and JavaDoc documentation. Also available for download (included in the above zip file) is the main zmanim-1.2.jar. The zmanimAstronomical-1.1.jar that only includes the AstronomicalCalendar was not impacted by this change, but the version has been updated to zmanimAstronomical-1.2.jar for consistency. Additional detail on the downloads can be seen on the Zmanim Download page

Elevation Now Only Impacts Sunrise and Sunset Calculations in the Zmanim API

Sunrise over Everest

Note: On Aug 1, 2018 – כ״א אב תשע״ח, elevation became optionally available as a factor in most zmanim calculations. The KosherJava Zmanim library was updated to optionally allow using elevation as an attribute that will adjust most zmanim via the ZmanimCalendar​.setUseElevation(boolean). There are some zmanim such as degree-based zmanim that are driven by the amount of light in the sky and are not impacted by elevation. These zmanim intentionally do not support elevation adjustment. The following is the original post.


I have received a few emails over the past year or so about the use of elevation as part of the calculation of various zmanim in the API. All releases of the zmanim API up to the current 1.1 release, use elevation to affect the calculation of all sunrise/sunset based zmanim. While my footnote on the Zmanim Calendar Generator page stated that this only impacted sunrise and sunset (quoting the Yisrael Vehazmanim and Calendrical Calculations), in practice all zmanim calculated based on sunrise and sunset were affected by elevation. An example of a zman that used elevation in 1.1, but will no longer in 1.2, is the calculation of Sof Zman Krias Shema according to the GR”A. The soon to be released version 1.2 limits the impact of elevation to sunrise and sunset only. The Zmanim Calendar Generator page already uses the latest changes to the code. To facilitate changes by ports of the API, a list of changes to the source code of the ZmanimCalendar.java and ComplexZmanimCalendar.java is available in a diff file (a proper Unix diff/patch is not available at this time). The diff files were generated prior to updating the JavaDocs to simplify the work of anyone modifying ports of the Zmanim API. Detailed sources for not using elevation for anything besides sunrise and sunset can be found in פרק ב׳ סעיף ט׳ (pages 186-187) in the second edition of Zmanim Kehilchasam זמנים כהלכתם by Rabbi Dovid Yehuda Bursztyn.

ZmanimCLI (Command Line Interface)

Java Logo SepiaMoshe Wagner who wrote the Zmanim GUI notified me in August that that he created a command line interface for zmanim using my Zmanim API. The technical approach of using reflection was similar to the way I used reflection in the Zmanim Clock Applet, but he took it to new heights. Sample use of accessing zmanim using his CLI interface is:

moshe@debian:~/Desktop$ java -jar ZmanimCLI.jar sunrise
6:10:28
moshe@debian:~/Desktop$ java -jar ZmanimCLI.jar --date 2010/08/12 tzais72
20:38:15
moshe@debian:~/Desktop$ java -jar ZmanimCLI.jar
Usage: ZmanimCLI [options] [Time]

Options:
       -d      --date <yyyy/mm/dd>             Set date. (Year first!)
       -lat    --latitude <latitude>           Set location's latitude
       -lon    --longitude <longitude>         Set location's longitude
       -e      --elevation <elevation>         Set location's
elevation; Positive only
       -tz     --timezone <timezone>           Set location's TimeZone

Help:
       -h      --help                          Show this help
       -stl    --time-list                     Show common available
times to display
       -ftl    --full-time-list                Show all available
times to display
       -tzl    --timezone-list                 Show available timezones

Example:
       ZmanimCLI --latitude 31.7780 --longitude 35.235149 --elevation
600 --timezone Israel Sunrise
       Will show the sunrise time today in Jerusalem

While your first reaction may be that it is interesting in a theoretical geeky way, but has no practical value, I will quote Moshe’s explanation as to why it is useful:

Why is this useful? Well, first of all it was a nice experiment. But mainly, you can now use Zmanim (although externally), via any language you want, no longer being tied to Java.

Months later, Moshe actually put this to practical use in his C++ based Luach project. This Luach (similar to the known Kaluach) uses the Qt framework. utilizing libhdate for the date stuff (something not offered by the Zmanim API, and the topic of a future Zmanim API FAQ), displaying zmanim using the Zmanim API via CLI for the zmanim calculations. While you would expect such an approach to be slow, using the Luach seemed almost instantaneous. I will post more about his Luach program (recently reviewed at KosherDev.com) at some point in the future.

FAQ: Where is the Zmanim API Main Method?

KosherJava Zmanim API FAQ

Question:

Where is the main method?

Answer:

This is a more technical variant of the “How do I install the Zmanim API Program?”, 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 program. Since this is a library/API and not a program, it does not have a main method. The code to generate zmanim is spelled out in the How to Use the Zmanim API page. 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 Lakewood, NJ. Please ensure that the Zmanim jar (download) is in your classpath.

/**
 * This program is a simple demonstration of the kosherjava.com Zmanim API.
 * To compile, ensure that the Zmanim Jar is in your classpath.
 */
import com.kosherjava.zmanim.*;
import com.kosherjava.zmanim.util.*;
import java.util.TimeZone;
public class SimpleZmanim{
	public static void main(String [] args) {
		String locationName = "Lakewood, NJ";
		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("America/New_York");
		//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("Today's Zmanim for " + locationName);
		System.out.println("Sunrise: " + zc.getSunrise()); //output sunrise
		System.out.println("Sof Zman Shema GRA: " + zc.getSofZmanShmaGRA()); //output Sof Zman Shema GRA
		System.out.println("Sunset: " + zc.getSunset()); //output sunset
	}
}

The following would compile and execute this code (sample from a DOS prompt in Windows).

C:\path\to\code>javac SimpleZmanim.java

C:\path\to\code>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

Please see the Zmanim API documentation for a more complete view of the API.