Day length calculator

Enter your city's latitude and pick a date to get the day length in hours and minutes, the Sun's noon altitude, and whether the Sun never sets or never rises near the poles.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter latitude (south is negative) and date.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Solar declination δ comes from Meeus's low-precision solar position at 12:00 UT. Hour angle cos H = (sin(−0.833°) − sin φ sin δ) ÷ (cos φ cos δ), and day length = 2H ÷ 15 hours. The −0.833° allows for refraction and the Sun's half disc; civil twilight uses −6°.

Example

Inputs: Latitude (south is negative) = 24.7136 °, Date = 2024-06-20. Result: Day length: 13.67 h; Day length (h:mm): 13:40; Night length: 10.33 h.

Limits and caveats

  • Declination is taken at 12:00 UT, so results can differ from official tables by a minute or two, more near the polar circles.
  • Assumes a flat horizon at sea level; hills or elevation shift the real sunrise and sunset.
  • Gives the length of the day only, not local clock times for sunrise and sunset or prayer times.

Questions about this tool

Why are days longer in summer and shorter in winter?

Earth's axis is tilted about 23.44 degrees, so the Sun's declination changes through the year and its path above the horizon lengthens in the hemisphere tilted towards it.

Why is the day longer than 12 hours at the equinox?

Sunrise and sunset are counted at the top edge of the Sun's disc and the atmosphere bends light, which adds about 7 minutes at the equator.

Is day length the same as fasting hours?

No. A fast starts at dawn, usually more than an hour before sunrise, so it lasts longer than the day length shown here.