Three angles, then a clock reading
Day length is fixed by two angles only: your latitude φ and the sun's declination δ, its angular distance north or south of the celestial equator on your date. Declination is approximated by Cooper's equation, which is good to a fraction of a degree for this purpose:
δ = 23.45° × sin(360° × (284 + N) ÷ 365)
Here N is the day of the year (21 June is day 172, 21 December day 355) and δ runs from +23.45° at the June solstice to −23.45° at the December solstice, crossing zero at the equinoxes. The sunrise hour angle ω — how far, in degrees, the sun sits from solar noon when it touches the horizon — then comes from spherical trigonometry, with the standard −0.833° correction for atmospheric refraction and the sun's own disc:
cos ω = (sin(−0.833°) − sin φ × sin δ) ÷ (cos φ × cos δ)Day length is 2ω ÷ 15, because the Earth turns 15° an hour. Sunrise and sunset on the clock need two more ingredients: the equation of time, the difference between apparent solar time and clock time caused by Earth's elliptical orbit and tilted axis (up to about ±16 minutes through the year, approximated here by the NOAA formula), and the gap between your longitude and your time zone's reference meridian (15° per hour of UTC offset). Solar noon on your clock is 12:00 − equation of time ÷ 60 − (longitude − 15 × UTC offset) ÷ 15; sunrise is solar noon minus half the day length, sunset solar noon plus half of it.
Worked example: London, 21 June 2026
Day 172 of the year: δ = 23.45° × sin(360° × (284 + 172) ÷ 365) = 23.45° × sin(449.75°) = +23.45°, the solstice value. At latitude 51.5074°, cos ω = (sin(−0.833°) − sin(51.5074°) × sin(23.45°)) ÷ (cos(51.5074°) × cos(23.45°)) = −0.5709, so ω = 124.82° and day length = 2 × 124.82° ÷ 15 = 16.64 hours = 16h 39m. The equation of time on day 172 is −1.45 minutes, and with longitude −0.1278° and UTC offset +1 (British Summer Time), solar noon = 12:00 − (−1.45 ÷ 60) − (−0.1278 − 15) ÷ 15 = 12:00 + 0.02 + 1.01 = 13:02. Sunrise = 13:02 − 8h 19m = 04:43, sunset = 13:02 + 8h 19m = 21:21 — matching the published London almanac times for 21 June to the minute. The table on the calculator shows the same city through the year: 12h 07m on 21 March (06:05 → 18:12, UTC offset +0), 12h 09m on 21 September (06:48 → 18:57, offset +1) and 7h 49m on 21 December (08:04 → 15:54, offset +0). Three cross-checks from other latitudes confirm the clock conversion: New York (40.7128°N, −74.006°, offset −4) on 21 June gives 15h 06m, sunrise 05:25, sunset 20:30 — the published times are 05:24 and 20:30, one minute apart; Sydney (−33.8688°, 151.2093°, offset +11) on 21 December gives 14h 25m, 05:41 → 20:06, again matching the almanac to the minute; and Reykjavik (64.1466°N) on 21 June gives 21h 09m with sunset at 00:04 the next day — the sun barely sets at all, and the page says so instead of hiding the day change.
How to read your result, and its limits
Four cautions keep the numbers honest. First, clock times are approximate to a few minutes: Cooper's declination and the NOAA equation of time are approximations, and real sunrise is moved by local hills, buildings and weather — never use these times for navigation, prayer-time rulings or legal deadlines. Second, the UTC offset is yours to get right: the calculator cannot know whether your date falls in daylight saving, so entering London as +0 in June shifts both times an hour early; the offset field's note says this, and the worked example uses +1 for June and +0 for December deliberately. Third, inside the polar circles the answer is a state, not a time: when the hour-angle argument leaves the −1 to +1 range, the sun never rises (polar night, 0h) or never sets (midnight sun, 24h), and the calculator reports that state rather than a fictitious sunrise. Fourth, day length does not depend on longitude at all: two cities on the same latitude share the same day length on the same date whatever their time zones, which is why the table's London figures also describe every other place on 51.5°N. For the moon on the same night, use the moon phase calculator; for converting a moment between cities, the time zone converter carries the real offset for that date.
Common mistakes
- Entering today's UTC offset for a date in the other half of the year. Daylight saving moves the offset by an hour, and both clock times move with it. Always enter the offset in force on your date.
- Expecting exactly 12 hours at the equinox. The −0.833° refraction correction stretches every day slightly, so the equinox day reads 12h 07m at London, not 12h 00m — the geometric 12-hour day and the visible-sunrise day are different things.
- Reading a polar "sunrise" off a tool that always prints one. Above the Arctic Circle in summer there is no sunrise to print; a tool that shows one anyway is extrapolating the formula past its range. This page reports midnight sun or polar night instead.
- Assuming longitude changes day length. It does not — it only shifts the clock reading. Madrid and New York, both near 40°N, share nearly identical day lengths on the same date despite sitting in different time zones.
Related tools: Hiking Time Calculator — Your trail time from distance and ascent by Naismith's Rule — walking time, breaks and arrival time, in metric or imperial units.
Frequently asked questions
How many hours of daylight will there be on a given date?
Enter the latitude and date: the calculator gives the day length from the solar declination and the sunrise hour angle. London on 21 June gets 16h 39m of daylight; on 21 December it gets 7h 49m; at the equator it is about 12h 07m all year.
Why is sunrise not exactly 12 hours before sunset?
Because solar noon is rarely at 12:00 on the clock: the equation of time shifts it by up to about 16 minutes through the year, and your longitude's distance from your time zone's reference meridian shifts it further — London's solar noon is 13:02 in June under British Summer Time, so sunrise and sunset sit symmetrically around 13:02, not around 12:00.
Does daylight depend on longitude?
Day length does not — it depends on latitude and date only, so two cities on the same latitude share the same day length. Longitude and UTC offset only place sunrise and sunset on your clock, which is why this calculator asks for them separately.
What happens inside the Arctic Circle in summer?
The sun never sets, and the calculator says so: midnight sun, 24h 00m of daylight, with no sunrise or sunset printed. In winter the reverse applies — polar night, 0h 00m. Printing a sunrise time in either case would be inventing a number the sky does not contain.

