Arithmetic, time and navigation
Day length by latitude and date
Calculates how many hours of daylight there are at a place and date, and the approximate solar time of sunrise and sunset.
How it is calculated
Solar declination: the calculator uses Spencer's series (1971), accurate to within 0.05°. For working by hand, Cooper's formula (1969) will do, though it is up to 1.3° off in autumn: δ = 23.44° × sin(360/365 × (284 + n)), with n the day number of the year.
Sunrise/sunset hour angle: cos ω0 = (sin(−0.83°) − sin(latitude) × sin δ) ÷ (cos(latitude) × cos δ). The −0.83° term corrects for atmospheric refraction and the radius of the solar disc (the sun is seen to rise or set a little before or after the exact geometric calculation).
Day length (h) = 2 × ω0 ÷ 15 (the Earth turns 15° per hour). Sunrise = 12 − ω0 ÷ 15 and sunset = 12 + ω0 ÷ 15, in solar time (solar noon = 12:00).
Example in Madrid (40.4° N) on 21 June: δ ≈ 23.44°, ω0 ≈ 112.9°, length ≈ 2 × 112.9 ÷ 15 ≈ 15 h.
Example at the equator (0°) at the equinox (21 March): δ ≈ 0°, ω0 ≈ 90.8°, length ≈ 2 × 90.8 ÷ 15 ≈ 12 h 7 min (more than 12 h due to refraction, even at the equator).
Keep in mind
- Solar time does not match the official clock time: it needs to be corrected for time zone, daylight saving, and the equation of time (up to ±16 minutes depending on the time of year).
- Above about 66.5° of latitude there can be midnight sun in summer or polar night in winter: the formula warns when this happens.
- The day and month are counted as a year without leap years; the error is under a day.