Sunrise Sunset Calculator
Calculate sunrise, sunset, and daylight hours for any location and date on Earth. Enter values for instant results with step-by-step formulas.
Reviewed by Daniel Agrici, Founder & Lead Developer
Formula
Hour Angle = arccos((sin(-0.833ยฐ) - sin(lat) ร sin(dec)) / (cos(lat) ร cos(dec)))
The sunrise/sunset hour angle is computed from the observer's latitude and the Sun's declination. The -0.833ยฐ accounts for atmospheric refraction (0.567ยฐ) and the Sun's apparent radius (0.266ยฐ). Solar declination is derived from the ecliptic longitude, which depends on the date via the solar mean anomaly and equation of center.
Worked Examples
Example 1: Summer Day in New York
Problem:Find sunrise and sunset for New York City (40.71ยฐN, 74.01ยฐW) on June 21.
Solution:Using solar position calculations:\nSolar declination โ +23.44ยฐ\nHour angle โ 112.8ยฐ\nSunrise โ 05:25 UTC (local 01:25 EDT โ adjusted)\nDaylight โ 15.05 hours
Result:Sunrise: ~05:25, Sunset: ~20:31 (UTC) โ approximately 15 hours of daylight
Example 2: Winter in London
Problem:Find sunrise and sunset for London (51.51ยฐN, 0.13ยฐW) on December 21.
Solution:Solar declination โ -23.44ยฐ\nAt 51.5ยฐN with negative declination, very short day\nDaylight โ 7.9 hours
Result:Sunrise: ~08:04, Sunset: ~15:53 (UTC) โ approximately 7.9 hours of daylight
Frequently Asked Questions
How are sunrise and sunset times calculated?
Sunrise and sunset are calculated using the sun's position relative to the observer. The algorithm computes the Julian date, solar mean anomaly, equation of center, ecliptic longitude, solar declination, and hour angle. Sunrise occurs when the sun's center is 0.833ยฐ below the horizon (accounting for atmospheric refraction of 0.567ยฐ and the sun's apparent radius of 0.266ยฐ). These calculations use the NOAA solar position algorithm, accurate to within 1-2 minutes.
References
Reviewed by Daniel Agrici, Founder & Lead Developer ยท Editorial policy