Sunrise and Sunset Calculator: Day Length and Twilight Times
By FindMySum · Last reviewed
How long will it be light today? When does it get dark enough to see the stars? This sunrise sunset calculator gives sunrise, sunset, solar noon, the length of the day and the three stages of twilight for any place on Earth, using its latitude and longitude, on any date, in the time zone you choose with daylight saving time applied. A chart shows how the day lengthens and shortens through the year, and a table lists the next seven days.
How the calculation works
The calculator follows the equations behind the NOAA Solar Calculator, which come from Jean Meeus's Astronomical Algorithms. For the moment in question it computes where the Sun is along its yearly path, and from that two quantities:
- Declination (δ): how far north or south of the equator the Sun is, from +23.4° at the June solstice to −23.4° in December.
- Equation of time: how far the Sun runs ahead of or behind an even clock, up to about 16 minutes, because Earth's orbit is elliptical and its axis tilted.
Solar noon, when the Sun is highest, happens at 720 − 4 × longitude − equation of time minutes after midnight UTC. The Sun rises and sets at a time either side of noon given by the hour angle H:
cos H = cos z ÷ (cos φ × cos δ) − tan φ × tan δ
where φ is the latitude and z the zenith angle of the event. Each degree of hour angle is four minutes of time. The calculator repeats the calculation at the moment of each event so that the Sun's position is the one at sunrise, not at noon.
Why 90.833°?
Sunrise is the moment the top of the Sun's disc touches the horizon. Two corrections move that moment earlier than the geometric one: the atmosphere bends sunlight over the horizon by about 34 arcminutes, and the Sun's radius is about 16 arcminutes. Together they put the Sun's centre 0.833° below the horizon at sunrise and sunset, so z = 90.833°. That adds several minutes of daylight at each end, which is why the equinox day is a little longer than 12 hours.
Twilight
After sunset the sky stays light while the Sun is not far below the horizon. Three standard stages, by the depth of the Sun's centre:
| Twilight | Sun below the horizon | What you notice |
|---|---|---|
| Civil | 0.833° to 6° | Enough light for most outdoor activities without lights |
| Nautical | 6° to 12° | The horizon at sea fades; bright stars appear |
| Astronomical | 12° to 18° | The last glow fades; after it the sky is fully dark |
In summer at high latitudes the Sun may never get 18° below the horizon, so astronomical twilight lasts all night. The calculator then shows a dash for those times.
Worked example: Ottawa in November
The calculator opens at Ottawa (45.42°N, 75.70°W) in Eastern Time. On 8 November 2026:
- Astronomical dawn 05:10, nautical dawn 05:45, civil dawn 06:20
- Sunrise 06:52, solar noon 11:46, sunset 16:40
- Civil dusk 17:12, nautical dusk 17:47, astronomical dusk 18:22
- Day length 9 hours 48 minutes, shrinking by about two and a half minutes a day
At the June solstice the same place has sunrise at 05:15 and sunset at 20:55 (daylight time), 15 hours 40 minutes of daylight; at the December solstice, under 9 hours.
Polar day and polar night
North of the Arctic Circle the Sun stays up all day around the June solstice: the hour-angle formula has no solution, because cos H would have to be below −1. Around the December solstice it stays below the horizon all day (cos H above 1). The calculator reports these as midnight sun and polar night, and still gives the twilight times when they exist: at Longyearbyen, Svalbard, the Sun doesn't rise in late December, but there is a short nautical twilight around noon. Near the poles the times are less precise, because the Sun moves almost parallel to the horizon.
Time zones and daylight saving
Times are calculated in UTC and then shown in the time zone you pick, using the zone's daylight saving rules for that date, so a place keeps the right offset through the spring and autumn clock changes. The year chart shows the jump when the clocks change. Pick the zone of the place, not the one you are in.
Coordinates
Latitude is positive north of the equator and negative south; longitude is positive east of Greenwich and negative west, so everywhere in Canada and the United States has a negative longitude. "Use my location" reads your device's position; it stays in your browser and only the rounded coordinates go into the page's link. Two decimal places (about 1 km) are plenty: moving 1 km east or west changes sunrise by only a few seconds.
Accuracy
Between about 72°N and 72°S, the times match national almanacs such as the National Research Council Canada tables to within a minute. Real conditions add their own variation: hills and buildings hide the horizon, height above the surroundings shows the Sun earlier, and unusual temperature layers change refraction. For that reason sunrise and sunset are always quoted to the minute.
More questions
Why are sunrise and sunset not symmetric around noon on my clock?
Because clock noon and solar noon differ. Your time zone is centred on a reference meridian, you may be east or west of it, daylight saving time adds an hour, and the equation of time shifts solar noon by up to about 16 minutes through the year. Sunrise and sunset are symmetric around solar noon, which the calculator shows.
Does elevation change sunrise time?
Yes. From a height you see over the curve of the Earth, so the Sun rises earlier and sets later: roughly a minute or two from a tall building and several minutes from a mountain. Nearby hills do the opposite. The calculator assumes a flat horizon at sea level, like published tables.
When are the days getting longer fastest?
Around the equinoxes in March and September, when day length changes by up to three minutes a day in southern Canada and more further north. Near the solstices it barely changes from one day to the next. The 7-day table shows the daily change.
Is day length the same everywhere on the equinox?
Nearly, but slightly more than 12 hours, because refraction and the size of the Sun's disc add a few minutes of daylight at each end. Ottawa has about 12 hours 10 minutes of daylight on the March equinox.
What is the golden hour?
Photographers' name for the soft light when the Sun is low, roughly from sunset until it is about 6° below the horizon, and the same before sunrise. It is not a fixed hour: it lasts longer at high latitudes and in winter, when the Sun's path meets the horizon at a shallow angle.
Sources
This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.