Sunrise and Sunset Calculator
Clock times of sunrise and sunset and the length of the day for any place and day of the year, with how the day length changes through the year.
Results
The dashed line marks the value you entered.
What this tool does
Sunrise and sunset are the moments the top edge of the Sun touches the horizon, which with atmospheric refraction happens when its centre is 0.833° below it — so a day at the equinox is a few minutes longer than twelve hours. The times are in the clock time you enter, so include summer time in the UTC offset. Hills, buildings and unusual refraction can shift what you actually see by a few minutes. Day of year: 1 January is 1, 21 June is 172 and 21 December is 355 in a normal year.
Formula
cos ω₀ = (sin(−0.833°) − sin φ sin δ) ÷ (cos φ cos δ) · sunrise / sunset = solar noon ∓ ω₀ ÷ 15°
Variables
| Symbol | Meaning | Unit |
|---|---|---|
la | Latitude | ° |
lo | Longitude (east positive) | ° |
tz | Clock offset from UTC (with summer time) | h |
nd | Day of the year | — |
SRH | Sunrise — hour | — |
SRM | Sunrise — minutes | — |
SSH | Sunset — hour | — |
SSM | Sunset — minutes | — |
DL | Day length | h |
ST | On this day | — |
Worked example
- Latitude38.72 °
- Longitude (east positive)-9.14 °
- Clock offset from UTC (with summer time)1 h
- Day of the year283
- Sunrise — hour7
- Sunrise — minutes39
- Sunset — hour19
- Sunset — minutes7
- Day length11.46 h
- On this dayThe Sun rises and sets
Limitations
- Declination and the equation of time come from Spencer's 1971 series, good to a small fraction of a degree. Atmospheric refraction, which lifts the Sun by about half a degree at the horizon, is not included.
- The default values are typical reference figures, not measurements of your situation. Replace them with your own data whenever you have it.