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.
Last updated: September 2026
Formula below · 2 sources (usgs.gov, Wikipedia) · Updated Sep 2026
Compare with similar
About this calculator
The calculator uses a simplified solar model. First, the solar declination δ is found with Cooper's equation: δ = 23.45° × sin(360° × (284 + N) / 365), where N is the day of the year. Sunrise is defined as the moment the sun's upper edge appears on the horizon, which happens when its centre is at h₀ = −0.833° (0.267° for the sun's radius plus about 0.567° of atmospheric refraction), lowered further by the horizon dip from your elevation (≈ 0.0347° × √elevation in metres). The hour angle at sunrise is H = arccos[(sin h₀ − sin φ · sin δ) / (cos φ · cos δ)], clamped to [−1, 1] to handle polar day and night. Converting H to hours (÷15°) gives sunrise = 12 + (timezone × 15 − longitude) / 15 − H, in local standard time; sunset is the mirror image, 12 + (timezone × 15 − longitude) / 15 + H, and day length is 2H. The longitude term shifts solar noon for your position within the time zone (Earth rotates 15° per hour). The result is decimal hours (4.5 = 04:30) in the standard time of the selected offset — add one hour yourself if daylight saving time is in force. Results are approximate (within about 5–10 minutes) because the equation of time is not included.
How to use
For London (lat = 51.5°, lon = −0.13°, timezone = UTC+0, elevation 0) on the summer solstice (day 172): δ = 23.45 × sin(360 × 456 / 365) ≈ 23.45°. cos H = (sin(−0.833°) − sin 51.5° × sin 23.45°) / (cos 51.5° × cos 23.45°) ≈ −0.571, so H ≈ 124.8° = 8.32 hours. Sunrise ≈ 12 + (0 + 0.13) / 15 − 8.32 ≈ 3.69, i.e. 03:41 GMT = 04:41 BST (almanac: 04:43 BST). Sunset is 12.01 + 8.32 ≈ 20.33 GMT = 21:20 BST, and day length is about 16.6 hours.
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 that includes standard refraction and horizon dip and is accurate to within roughly 5–10 minutes for most mid-latitude locations. Official almanac times (e.g., from the US Naval Observatory) use full ephemeris calculations that also account for Earth's elliptical orbit (the equation of time, up to ±16 minutes) and precise declination. 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. During midnight sun the calculator returns a "sunrise" at local solar midnight (about 12 hours before solar noon, meaning the sun never sets), and during polar night it returns solar noon itself (the sun never rises). These extreme conditions occur above roughly 66.5° latitude and are most pronounced around the solstices.