Understanding the sunrise and sunset calculator — concept and principle
This calculator finds sunrise, sunset, solar noon and day length for any place and date, using the solar position equations published by NOAA. It helps plan photography, hiking or outdoor work.
How it is calculated
- Day of year N and fractional year γ = 2π/365 × (N − 1).
- Equation of time (minutes) and solar declination δ from short Fourier series in γ (coefficients by J. W. Spencer, 1971).
- Hour angle at sunrise: cos H = cos 90.833° ÷ (cos φ cos δ) − tan φ tan δ, where φ is latitude.
- Solar noon (minutes after local midnight) = 720 − 4 × longitude − equation of time + 60 × UTC offset.
- Sunrise = noon − 4H, sunset = noon + 4H (H in degrees; Earth turns 1° every 4 minutes).
If |cos H| > 1, the Sun never sets (midnight sun) or never rises (polar night) that day.
The principle
At sunrise the Sun's centre is 0.833° below the geometric horizon: about 0.567° (34′) for atmospheric refraction, which lifts the image, plus 0.267° (16′) for the Sun's radius, because sunrise is defined by the upper edge. Spherical trigonometry gives the hour angle at that altitude. Declination sets how high the Sun's daily circle runs, so days are long in summer and short in winter. The equation of time corrects for Earth's elliptical orbit and axial tilt, which make true solar noon drift up to about 16 minutes either side of 12:00 mean time.
Worked example
- Inputs: Seoul, latitude 37.57°, longitude 126.98°, UTC+9, 8 November 2026 (day 312).
- Equation of time ≈ +16.09 min; declination ≈ −16.36°.
- cos H = 0.2067, so H = 78.07°, or 312.3 minutes.
- Solar noon = 720 − 507.92 − 16.09 + 540 = 735.99 min = 12:16.
- Sunrise = 735.99 − 312.28 = 423.71 min = 07:04; sunset = 1,048.27 min = 17:28.
- Day length = 624.57 min = 10 h 25 min (from unrounded times, so it may differ by a minute from the displayed ones).
How to read the result
Korean time uses the 135° E meridian but Seoul lies near 127° E, so solar noon there averages about 12:30; in early November the Sun runs fast, giving 12:16. Day length near the equator stays close to 12 hours all year; at higher latitudes the seasonal swing grows rapidly.
Common mistakes
- Entering west longitude or south latitude as positive; use negative numbers.
- Using the wrong UTC offset, especially where daylight saving time applies.
- Expecting the times to apply on a mountain top or at sea level with a clear horizon; terrain and elevation change them.
Frequently asked questions
Why is the earliest sunset not on the shortest day?
Because the equation of time is changing quickly in December, solar noon keeps moving later, so the earliest sunset comes in early December and the latest sunrise in early January in mid-northern latitudes.
Does altitude change sunrise time?
Yes. From high ground the horizon dips, so the Sun appears earlier and sets later than the calculator shows.
Sources: NOAA Global Monitoring Laboratory, General Solar Position Calculations · J. W. Spencer, Fourier series representation of the position of the Sun, Search 2(5), 172 (1971) · J. Meeus, Astronomical Algorithms, 2nd ed., Willmann-Bell, 1998, Chapter 15