GenerateRandomSearch

Sunrise and Sunset Calculator

Doing this by hand means the solar position equations and half an hour with a calculator, which is why most people guess. Give a place and a date and you get sunrise, sunset, the moment each twilight begins, when the golden hour opens and closes, and how much daylight there is between the two ends of the day.

What this generator does

Computes the sun's declination and the equation of time for the date, then solves for the moment the sun crosses each of the angles that define sunrise, the twilights and the golden hour.

How to use this tool

  1. Pick a place from the list, or type a latitude and longitude.
  2. Choose the date and how many hours ahead of UTC to show times in.
  3. Read the sunrise, sunset, twilights and golden hour.
  4. Copy the whole set if you are planning around them.

Understanding the controls

Somewhere to start from
A short list of places that fills in the coordinates and time zone for you. Everything is worked out from the numbers, so anywhere on Earth can be typed in instead.
Date
Any date, past or future. The formulae are quoted as good to about a minute across the present century, which is finer than the day-to-day variation from the atmosphere.
Latitude
Degrees north of the equator, written negative for south. Above about 66 degrees the sun stops rising or setting at midsummer and midwinter, and the page says so rather than showing a made-up time.
Longitude
Degrees east of Greenwich, written negative for west. This is what shifts solar noon away from twelve o'clock.
Hours ahead of UTC
The offset the times are shown in — one for British Summer Time, zero for GMT. Daylight saving is not applied for you, because when it starts differs by country.

Common use cases

  • Planning a photograph for the golden hour rather than guessing at it
  • Working out how much daylight a walk or a climb leaves you
  • Knowing when it is properly dark for stargazing, which is astronomical twilight
  • Setting a lighting or heating schedule that follows the season
  • Checking how far north you have to go before the sun stops setting

How this generator works

The sun's declination and the equation of time come from the low-precision formulae of the Astronomical Almanac. Each event is the moment the sun's centre crosses a particular angle: minus 0.833 degrees for sunrise, which allows for refraction and the sun's own width, then six, twelve and eighteen degrees below for the three twilights, and six degrees above for the end of the golden hour. Two kinds of check follow. Internally, solar noon must fall exactly midway between sunrise and sunset and the twilights must nest in order around them. Externally, the page carries published almanac times for four places and dates and compares against them, because an internally consistent implementation of the wrong formula is still wrong.

Randomness and fairness

Nothing is random. The same place and date always give the same times.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Daylight saving is not applied automatically — set the offset to whatever is in force on the date.
  • Height above sea level and local hills are not accounted for; a horizon obscured by a ridge comes later than this says.
  • Refraction is taken as the standard allowance, and unusual air moves the real thing by a minute or two.
  • The formulae are the low-precision set, good to about a minute across the present century rather than to the second.

Privacy and your data

The coordinates are used only for the arithmetic in your browser. No location is looked up, transmitted or stored.