Daylight Hours Calculator — Sunrise to Sunset by Latitude
Enter a latitude and a date to find the hours of daylight, approximate solar sunrise and sunset times, and the solar declination — including detection of polar day (midnight sun) and polar night conditions.
°
16 h 15 min
- 1
Day of year N
186Count of days since January 1 (Jan 1 = 1), accounting for leap years. - 2
Solar declination δ = −23.45 × cos(2π × (N+10) ÷ 365)
−23.45 × cos(2π × (186+10) ÷ 365) = 22.82 ° - 3
cos(H₀) = −tan(φ) × tan(δ)
−tan(51.5°) × tan(22.82°) = -0.529 - 4
Sunrise hour angle H₀ = arccos(cos H₀)
arccos(-0.529) = 121.94 ° - 5
Daylight hours = 2 × H₀ ÷ 15
2 × 121.94° ÷ 15 = 16.26 hEarth rotates 15° per hour, so H₀ degrees of hour angle equals H₀ ÷ 15 hours. Both sides of noon are included.
How does this calculator work?
Solar declination δ = −23.45°·cos(2π·(N+10)/365), where N is the day of year. The sunrise hour angle H₀ satisfies cos(H₀) = −tan(φ)·tan(δ). Daylight hours = 2H₀/15. If |tan(φ)·tan(δ)| > 1: polar night (0 h) or polar day (24 h). Sunrise/sunset times are solar approximations; actual clock times differ by longitude and the equation of time (up to ~30 min total).
Formula
How this is calculated
The calculation proceeds in three steps. First, the solar declination δ is computed from the day of year N using the Spencer approximation: δ = −23.45° × cos(2π × (N + 10) / 365). This models the tilt of Earth's axis; δ ranges from −23.45° at the December solstice to +23.45° at the June solstice and passes through 0° at the equinoxes (when daylight equals 12 h at all latitudes).
Second, the sunrise/sunset hour angle H₀ is found from cos(H₀) = −tan(φ) × tan(δ), where φ is the observer's latitude. When the right-hand side exceeds 1 in magnitude, the sun either never rises (polar night, cos > 1) or never sets (midnight sun, cos < −1). Otherwise, H₀ = arccos(cos(H₀)) in degrees.
Third, daylight hours = 2 × H₀ / 15, because Earth rotates 15° per hour and sunrise and sunset are symmetric about solar noon. Sunrise and sunset are then approximately 12 ± (daylight ÷ 2) hours in solar time (with solar noon at 12:00). Actual clock times differ from solar times by the observer's longitude offset from their time-zone meridian and by the equation of time (±16 minutes across the year). The formula ignores atmospheric refraction (~0.5° bending at the horizon, which adds ~4 minutes of daylight each day) and uses a fixed 365-day year.
Frequently asked questions
The calculator gives approximate solar times, assuming solar noon falls exactly at 12:00. Real clock sunrise and sunset times are shifted by (1) your longitude offset within your time zone (each degree of longitude = 4 minutes), and (2) the equation of time (Earth's elliptical orbit and axial tilt cause solar noon to vary by up to ±16 minutes). Atmospheric refraction also adds ~4 minutes of daylight by bending light around the horizon. The total error can be 30 minutes or more.
Above the Arctic Circle (latitude > 66.5°) in summer, the sun stays above the horizon for 24 hours continuously — called midnight sun or polar day. In winter at the same latitude, the sun does not rise at all — polar night. The transition latitude depends on the date; near the solstices the phenomenon extends to lower latitudes than exactly 66.5°.
The Spencer approximation used here has a maximum error of about 0.3° compared to the precise astronomical calculation, translating to roughly 1–2 minutes of daylight error. For most everyday purposes this is more than sufficient. High-precision astronomical calculations (ephemerides) are needed only for surveying, satellite work, or exact nautical twilight calculations.
Also known as
TG we-Calculate Editorial Team. (2026). Daylight Hours Calculator — Sunrise to Sunset by Latitude [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/daylight-calculator
TG we-Calculate Editorial Team. "Daylight Hours Calculator — Sunrise to Sunset by Latitude." TG we-Calculate. 2026. https://we-calculate.com/calculator/daylight-calculator.
TG we-Calculate Editorial Team, "Daylight Hours Calculator — Sunrise to Sunset by Latitude," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/daylight-calculator
@misc{wecalculate_daylight_calculator, title = {Daylight Hours Calculator — Sunrise to Sunset by Latitude}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/daylight-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
