ZIP Codes and Zmanim – Use With Care

99557 ZIP code area (the largest in the USA)
99557 ZIP code area (the largest in the USA)
There are many zmanim services and apps that use ZIP codes as a location finder for calculating zmanim. While very convenient, there is a potential pitfall in using ZIP codes for geolocation. In general, ZIP code geolocation services will provide the center of the ZIP code and zmanim apps calculate zmanim for that location. The issue arises with large ZIP code areas mostly found in rural areas. Take the following two extreme cases that have very large ZIP code areas. ZIP code 89049 for rural Tonopah, NV, is 195 km (121 mi) from east to west. The eastern boundary of this non-contiguous ZIP code has a longitude of -115.417°, while the western boundary is -117.625°. This means that there are 2.2° of longitude between the eastern and western borders of this ZIP code. The earth rotates 1 degree every 4 minutes, so zmanim at the eastern and western edges of this ZIP code are approximately 8.8 minutes apart. Using the typical center of the ZIP based calculations would mean that zmanim would be about 4.4 minutes different at the edges compared to the center. Moving to something a bit more extreme, is the case of ZIP code 99557 of Aniak, Alaska and its surrounding area. This ZIP code is 415 km (258 mi) from east to west. The longitude of the eastern edge of the ZIP code is -153.032°, and the western edge is -160.783°. Being farther north and therefore having shorter distances between degrees of longitude, this ZIP code stretches across 7.7° of longitude. The zmanim difference from the center to the edges of this ZIP code is 15 and a half minutes (31 minutes across the ZIP). While it is indeed rare to have such large distances, there are 193 US ZIP codes that are over 1° of longitude wide, meaning that the zmanim difference for these ZIP codes are at a minimum 4 minutes apart, or 2 minutes off from the center. There are 1,463 or 4.4% of all ZIP codes with 0.5° or greater distance between east and west (a minimum of a 2 minute zmanim difference between the east and west zide of the ZIP code). zmanim software developers should be aware of this, and take care to alert users of possible inaccuracies when using large ZIP code areas, or require addresses or more specific location information for large zip codes.
Let’s contrast the above with Lakewood, NJ. With 0.107° of longitude from east to west, zmanim are 24 seconds later on the west side (the intersection of New Central Ave & N Hope Chapel Rd) than the east side (Shinn Cranes, 1600 Ocean Ave). New York City is larger, and from the western edge of Staten Island to the edge of Glen Oaks, the eastern edge of Queens there is a 2 minute and 11 second difference in zmanim.
See the Calculation of Zmanim VS Other Sites post for additional related material.
I thank Avraham David Gelbfish for generating the ZIP code longitude range for all 33,093 ZIP codes from the US Census Bureau ZIP code shape files.

The Novaya Zemlya Effect’s Impact on Zmanim

Novaya Zemlya Effect Distorted Sun
A Distorted Sun Caused by the Novaya Zemlya Effect (Credit: Brocken Inaglory)
You may have seen disclaimers on zmanim calendars warning of up to a 2 minute inaccuracy due to weather and atmospheric conditions. Atmospheric refraction from the earth’s atmosphere, causes the sun to be visible on average about 3 minutes earlier at sunrise, and about 3 minutes later at sunset (compared to a vacuum) due to the atmosphere bending the sunlight upwards towards the viewer. The 3 minutes is only an average, and it can swing widely due to weather and atmospheric conditions. The typical variance caused by “non-average” atmospheric conditions would usually be within 2 minutes, resulting in the 2 minutes mentioned in the disclaimers. This 2 minute variance is during usual conditions, though there are conditions that would greatly increase this time.

Refraction Explained

Refraction at Sunset
Refraction at Sunset
When the sun’s rays traveling through the vacuum of space hit the earth atmosphere, they slow down and bend upwards towards the observer resulting in the sun being visible earlier (than in a vacuum) in the morning, and later at sunset.
Straw appearing to be bent due to refraction
Straw appearing to be bent due to refraction
Refraction of the sun’s rays is not a one stage refraction, but as the sun passes through increasingly dense layers of atmosphere, the amount of refraction increases with each thicker layer. This can be seen in the diagram of refraction at sunset above. The apparent position of the sun near sunset in the image (exaggerated in the image) is height of the sun as it appears to the user, though in reality the sun is below the horizon. Refraction can easily be observed by looking at a straw in a partially filled glass. The straw appears to bend (or be broken) at the point it enters the water. This is due to increased refraction in water versus air.

Complexity in Calculating Refraction

Since the amount of refraction depends on the pressure (the more dense the atmosphere is, the greater the refraction), temperature (hot air is less dense and refracts less) and to a lesser degree humidity (water vapor in the air impacts the refraction) in each layer of the atmosphere, calculating refraction is complex and requires very detailed meteorological information on the current conditions in each layer of the atmosphere in the area being computed. This can’t be done accurately in advance, and even calculations for the current day require readings from weather balloons at multiple elevations for accurate measurement, something not very practical (though the Lakewood vasikin minyan (likely done elsewhere as well) manually adjusts the hanetz hachama time each morning based on the weather). For this reason, zmanim (as well as civil sunrise and sunset) calculations usually use a global average refraction of 34′ of a degree, or 0.5666°. The global average atmospheric refraction accounts for sunrise being between 3:01 minutes earlier (during the solstice), and 2:29 minutes earlier (during the equinox) in Yerushalayim, as opposed to the value in a vacuum (the difference depends on where in the world you are, in Lakewood, NJ the range is 3:29 – 2:57). This average atmospheric refraction is not very accurate but is commonly used since it is complex to calculate local averages. More accurate refraction figures can be calculated for local and seasonal atmospheric models, and these have been shown to be accurate to within 15 seconds 90% of the time in the case of summer and winter subtropical models used in a study in Israel. See Using a Digital Terrain Model to Calculate Visual Sunrise and Sunset Times by Rabbi Chaim Keller and Dr. John K. Hall for additional details.

Inversion and the Novaya Zemlya Effect

Under usual conditions, the atmosphere gets colder at elevation, with the warmest air being closest to earth. An inversion condition is where there is a layer of cold air under a layer of warmer air. When there is an inversion over a large area (greater than 400 km), the solar rays get ducted in the lower colder air layer (see image below) and produce an extreme refraction. This is known as the Novaya Zemlya effect and produces a solar mirage resulting in the somewhat visually distorted sun being visible much earlier than expected (see top image).

Novaya Zemlya Effect Refraction Diagram (Credit: W. H. Lehn)
Novaya Zemlya Effect Refraction Diagram
While typically a phenomena in the polar regions, a study by the University of Calgary showed that refraction can have a significant affect on zmanim even in non-polar areas. In the 2003 study (Variability in the Astronomical Refraction of the Rising and Setting Sun), they observed that the sunrise on January 10, 1991 appeared almost 12 minutes earlier than expected. The paper mentions:

On rare occasions, the Sun appeared to rise much earlier or set much later than predicted by such publications as the Tables of Sunrise, Sunset, and Twilight (USNO 1962). In our study, the sunrise of 1991 January 10 was almost 12 minutes early. This phenomenon is known as the Novaya Zemlya solar mirage (Lehn 1979). It appears to be caused by a geographically extensive temperature inversion within the boundary layer of the atmosphere. The resulting vertical density profile causes the sunlight to be ducted around the curvature of the Earth. For the purpose of this study, we defined anomalously large astronomical refraction to be an event with refraction greater than 1°. A total of 12 anomalous events were recorded (2.9%).

While these typically occur in cold areas, they can happen in other areas as well. The study authors mention that

The majority of the anomalous events took place in the cold months. Nine of the 12 events occurred between November 1 and April 30, with January having five events. At the time of the events, the average surface temperature was -10.9°C, and all events occurred with surface-inversion conditions. Surface inversions tend to form with overnight surface radiative cooling through a dry atmosphere. Typically, they persist into the early morning, even after sunrise. Even though most of the events took place in the cold parts of the year, the data suggest that the Novaya Zemlya solar mirage may not be an exclusively cold-weather or polar phenomenon. Four of the events occurred with a surface temperature greater than 0°C. One event took place 2 days after the summer solstice.

Refraction at Sunrise VS Sunset

The University of Calgary study found that extreme refraction is an order of magnitude more common at sunrise than sunset. The reason for the difference between sunrise and sunset is that

This may be because the lower atmosphere is better mixed during the day as a result of solar heating leading to a dry adiabatic lapse rate in the boundary layer. Anomalously large astronomical refraction events the “Novaya Zemlya solar mirage” occurred about 3% of the time and were an order of magnitude more common at sunrise than sunset.

That said, The Novaya Zemlya effect does occur at sunset and in warm climates as seen in this video of sunset in San Francisco. Sadly, the video does not include information on how long it delayed sunset.


Halachically sunrise and sunset times depend on when we can see the sun, and not when it is at the horizon. As mentioned above, the average global refraction of 34′ results in sunrise appearing about 3 minutes earlier and sunset 3 minutes later later than in a vacuum, and this refraction (or other similar refraction values) is what is used in all calendars (both halachic and civil). The fact that there is such potential for variation in weather conditions, and that the global average is likely not what is present where the zmanim are being calculated, is the reason that many luchos (zmanim calendars) have disclaimers about accuracy. Many calendars round off their zmanim without showing seconds due to the inability to accurately calculate zmanim because of refraction variations. Lahalacha the impact of earlier or later sunrise is limited to vasikin minyanim. A separate article may be needed to actually discuss sof zman krias shema and other zmanim’s relation to sunrise and sunset VS the actual position of the sun in the sky (1/4 of the way across its path for sof zman krias shema). The halachic impact of refraction at sunset is much greater since it impacts the day/night boundary, but those are much rarer.
Now to the big question, does extreme refraction such as the Novaya Zemlya effect impact zmanim? The fact that it rarely impacts sunset, means that it almost academic since predicting the inversion before a vasikin minyan starts is impractical. In a conversation with one posek a number of years ago, he felt that the Novaya Zemlya Effect should not impact zmanim lahalacha due to the fact that unusual occurrences should not be factored in, and because the distorted sun is not considered the sun as far as zmanim. I would appreciate being notified if anyone receives a psak halacha on this question.

Zmanim Map 3.5 adds Date and Algorithm Selection

Vintage Map with CompassThe 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.

Zmanim Map v3.5

  • 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 Timezone 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

Bearing to Yerushalayim and Zmanim Map 3.0

Vintage Map with CompassThe Bearing to Yerushalayim and Zmanim Map was recently updated to version 3.0. This new release adds a number of new features to the Zmanim Map version 2.0 update released in March 2010. The main change was updating the Google Map API version from the deprecated v2 to v3. This change increases performance and adds much better support for mobile browsers. The upgrade also means that a Google Maps API key is no longer required. This makes it easy to drop it into any site without any configuration (contact me for details). Zmanim tab v3The technical notes on the original Technical Information about the Bearing to Yerushalayim Map post are still relevant, with very little having changed since the initial implementation.

The following is a partial list of the new features:

  • A number of additional zmanim in the More Zmanim tab, including tchilas and sof zman kiddush levana (if they occur on that day)
  • A link to download a 12 month Zmanim calendar directly from the map (using the same spreadsheet used in the Zmanim Calendar Generator). Clicking on the link from the Zmanim tab will generate a calendar with most typically used zmanim, while clicking on the link in the More Zmanim tab will download the full set of zmanim. These are available as the Calendar Type option in the Zmanim Calendar Generator
  • Increased use of jQuery and jQuery UI for formatting the zmanim tables to better match the site look & feel
  • Refactoring to make the code more robust and slightly more maintainable
  • Timezones for all of Israel now display the timezone of Asia/Jerusalem as opposed to the Asia/Gaza returned for parts of Israel by the GeoNames TimeZone web service

From a technical perspective there were a number of changes required due to updating the Google Maps API from v2 to v3. These include:

  • v3 no longer supports tabbed info windows, so the tabs are now implemented using jQuery UI
  • Renaming of a number of classes and functions such as GLatLng to LatLng
  • A number of functions that were part of API v2 were removed in v3. One example is the removal of radians in the LatLng that had been available as GLatLng.latRadians(). These missing functions required for the direction to Yerushalayim calculations are now supported in the Zmanim Map using prototypes

Davening Direction from Alaska

As mentioned briefly in the “Why Some Zmanim Never Occur” post, the Lubavitch Jewish Center of Anchorage, Alaska has an interesting davening direction question. As explained in the “Bearing to Yerushalayim and Zmanim Map” (additional technical information is available in the “Technical Information about the Bearing to Yerushalayim Map” post), there are two opinions about the proper direction to face during Tfilah. The Levush and others are of the opinion that one should face the rhumb line direction to Yerushalayim, while the Emunas Chachamim and others are of the opinion that one should face the initial bearing of the great circle route. Both of these opinions would clearly use the shortest rhumb or great circle lines to Yerushalayim. As an example, a person standing on Har Hazaisim a mile east of Har Habayis would not daven east using the logic that continuing east for approximately 21,175 miles[1] would reach Yerushalayim via global circumnavigation, when Har Habayis is just one mile west of him. The shul in Anchorage is located at a longitude of -149.86042°. The antipode of Har habayis is on the -144.764851 longitude line – 180° of longitude from Har Habayis. People on different sides of this line will daven in opposite directions. Anchorage with a longitude of -149.86042° is 169.69 miles (273.1 km) west of the the -144.764851° longitude line[2]. For this reason, the shul should daven not east, but west (255.78° from the north, or slightly south-west) if using the common rhumb line calculation, or north (355.67° from the north, or slightly west of north) if using the great circle calculation. Alaska is the only location in the world that has the -144.764851° longitude line cut across dry land, and is therefore the only non-ocean location to face this issue.

1. Based on a rhumb line along the 31° 50′ circle of latitude as opposed to 24,901 miles at the equator) using a WGS84 Reference ellipsoid.
2. Rhumb line calculation as calculated by Movable Type using the same latitude for both points. The ellipsoidal shape of the earth is factored into this calculation. The short distance means that the 169.66 (272.98 km) great circle distance is very close to the rhumb line distance.

FAQ: Why Some Zmanim Never Occur (Developers Beware)


Why do Some Zmanim Never Occur in Some Locations? (Developers Beware)


While most people realize that the sun may not rise or set in the Arctic and Antarctic Circles (see the Star-K’s When Does One Pray When There Is No Day), 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 summer solstice in London (on the zmanim map) the sun will never dip far enough below the horizon to reach Alos 16°. This happens in London from June 5th till July 8th. The image seen on the top right (original at shows various civil twilights centered on London on Midnight June 21st. Look carefully to see the various bands of twilight. Gateshead will not have Alos 16° from May 16th through July 28th, while Anchorage, Alaska (yes there is a Frum Shul in Anchorage with an interesting davening direction issue that is discussed in the Davening Direction from Alaska post ) will not have Alos 16.1° from April 25th to August 20th. Zmanim based on sunrise such as Also 72 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 null when a zman will not happen. A Long.MIN_VALUE will be returned when a long 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 NullPointerException.
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 Zmanim .NET project to return the nullable DateTime? instead of the regular DateTime that it had previously been returning. While the Zmanim API documentation 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.