geography calculators

Sunrise Sunset Time Calculator

Estimates local sunrise, sunset times, and total daylight hours for any latitude, longitude, and date. Ideal for photographers planning golden hour, gardeners, hikers, and solar energy assessments.

About this calculator

The calculator uses a simplified solar declination model. First, solar declination P is found via: P = arcsin(0.39795 · cos(0.98563° · (N − 173))), where N is the day of the year. Next, the hour-angle argument h = −tan(lat) · tan(P) is clamped to [−1, 1] to handle polar day/night. Sunrise = 12 − (12/π) · arccos(h) − lon/15 + timezone and sunset = 12 + (12/π) · arccos(h) − lon/15 + timezone, both in local hours. Daylight duration = sunset − sunrise. The factor lon/15 converts longitude to hours (Earth rotates 15°/hour). Results are approximate (±10 minutes) because Earth's orbit is elliptical and atmospheric refraction is not included.

How to use

For London (lat = 51.5°, lon = −0.13°, timezone = 0) on the summer solstice (day 172): P = arcsin(0.39795 · cos(0.98563 · (172−173))) ≈ arcsin(0.3978) ≈ 23.44°. h = −tan(51.5°) · tan(23.44°) ≈ −0.451. arccos(−0.451) ≈ 116.8° = 2.039 rad. Sunrise ≈ 12 − (12/π)·2.039 − (−0.13)/15 + 0 ≈ 4.21 (≈ 4:13 AM). Sunset ≈ 19.79 (≈ 7:47 PM). Daylight ≈ 15.6 hours, consistent with known London solstice data.

Frequently asked questions

Why do sunrise and sunset times vary by location even within the same time zone?

Sunrise and sunset depend on both latitude and longitude. Latitude determines the sun's maximum elevation and the seasonal swing in day length. Longitude shifts the clock time: locations further east within a time zone see the sun rise and set earlier in local clock time. The formula corrects for this with the term −longitude/15, converting geographic position to a time offset. This is why sunrise in eastern Spain can be nearly an hour earlier than in western Spain, despite both being in the same time zone.

How accurate is this sunrise sunset calculator compared to official almanac times?

This calculator uses a simplified solar model accurate to within roughly 5–15 minutes for most mid-latitude locations. Official almanac times (e.g., from the US Naval Observatory) use full ephemeris calculations accounting for Earth's elliptical orbit (the equation of time), atmospheric refraction (~0.57° at the horizon), and the observer's elevation. For casual planning — photography, outdoor activities, gardening — this approximation is perfectly adequate. For precise astronomical or navigational work, use a full-precision ephemeris tool.

What happens to sunrise and sunset times near the Arctic or Antarctic circles?

Near the poles, the sun's declination can exceed the complement of the observer's latitude, causing 24-hour daylight (midnight sun) or 24-hour darkness (polar night). Mathematically, the argument −tan(lat)·tan(P) falls outside the [−1, 1] domain of arccos, which the formula handles by clamping the value. The calculator will return 0 hours of daylight during polar night and 24 hours during midnight sun. These extreme conditions occur above roughly 66.5° latitude and are most pronounced around the solstices.