How to Calculate Sunrise and Sunset Time From Coordinates

Sunrise and sunset times depend on three things: your latitude, your longitude, and the date. Latitude sets how long the day is. Longitude and timezone set when that day sits on your clock. The calculation below gives solar-time results you can convert to clock time.

The ingredients

You need latitude (positive north, negative south), longitude (positive east, negative west), and the day number N (1 for 1 January). You also need the sun’s declination for that date, the angle of the sun above or below the equator. Declination swings between about +23.44 degrees at the June solstice and -23.44 at the December solstice, and is near zero at the equinoxes.

A handy approximation: declination = -23.44 x cos(360/365 x (N + 10)). On the March equinox (N around 80), this gives about 0 degrees, as expected.

The hour-angle step

The sunrise hour angle H comes from: cos(H) = (cos(90.833 degrees) – sin(latitude) x sin(declination)) / (cos(latitude) x cos(declination)). The 90.833 degrees is the sun’s zenith at rise and set, allowing for the sun’s radius and atmospheric refraction, which is why the sun appears slightly before geometric sunrise.

Sunrise in solar time is 12 – H/15 hours, and sunset is 12 + H/15 hours, because the earth turns 15 degrees per hour. At the equinox, declination is 0, so H is about 90 degrees at any latitude, giving sunrise at 6:00 and sunset at 18:00 solar time. That equinox check is a good way to verify your arithmetic.

From solar time to clock time

Convert solar time to local clock time in two steps. First, longitude: solar noon happens when the sun crosses your meridian, which is 12:00 solar time but not 12:00 clock time unless you sit exactly on your timezone’s central meridian. Adjust by (longitude – timezone meridian) / 15 hours. Second, add your timezone offset from UTC and any daylight saving in force.

Example: a place at longitude 0 in winter on UTC has no adjustment, so solar and clock times match. A place at longitude 15 degrees east on UTC+1 in winter also matches, because the timezone meridian is 15 degrees east. Places far from their timezone meridian can differ by an hour or more.

Edge cases

If cos(H) is greater than 1, the sun never rises that day: polar night. If it is less than -1, the sun never sets: midnight sun. Near the poles these conditions last weeks. At mid-latitudes the method is accurate to a few minutes, which is fine for photography, gardening, and planning. For navigation or legal purposes, use an official almanac, since the approximations here ignore the equation of time and local horizon effects like mountains.

Golden hour and twilight for photographers

Photographers care about more than sunrise and sunset. Golden hour, the hour after sunrise and before sunset, gives warm, low light. Blue hour, the period before sunrise and after sunset, gives deep blue skies. Civil twilight, when the sun is up to 6 degrees below the horizon, corresponds to a zenith of 96 degrees in the same hour-angle maths.

The same formula that gives sunrise gives twilight times: replace the 90.833-degree zenith with 96 for civil, 102 for nautical, and 108 for astronomical twilight. Planning a shoot from sunrise alone misses the best light, which often arrives before the sun itself.

Try it faster with the tool

You can follow every step above by hand, but the free Sunrise and Sunset Calculator by Coordinates (Latitude & Longitude) does the arithmetic for you. Enter your numbers and it gives the answer right away, so you can check your hand calculation or skip straight to the result.

Quick tips

  • Declination swings between +23.44 and -23.44 degrees.
  • Sunrise solar time = 12 – H/15; sunset = 12 + H/15.
  • Adjust solar time by longitude, timezone, and daylight saving.

Leave a Comment

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

Scroll to Top