geoprimsField-grade geospatial math

Sunrise, sunset, and twilight

Sunrise, sunset, solar noon, day length, and civil, nautical, and astronomical twilight for a place and local date, in local time and Zulu, with polar states.

A published result changed on 2026-09-18: Named IANA time zones like America/Denver are supported, so inputs that returned UNSUPPORTED now resolve to local times. Changelog

2026-06-21 05:32local (2026-06-21 1132Z)

Sunrise is 2026-06-21 05:32 local (2026-06-21 1132Z) and sunset is 2026-06-21 20:31 local (2026-06-22 0231Z).

Sunset
Solar noon
Day length
Civil dawn
Civil dusk
Nautical dawn
Provenance
Computed by
time.sun.events 1.0.0, core 0.1.0
Model
Geometric sun from the NREL Solar Position Algorithm; each crossing found by bisection between the day's highest and lowest points, which also decide polar states; sunrise and sunset at −0.833° (minus horizon dip when a height is given); solar noon from the NOAA equation of time
Accuracy
Within 1 minute of USNO on 1,200 events (300 places and dates, 94% to the same minute), including twilights that graze their altitude
Notes
None
Cites
Reda, I., and Andreas, A., National Renewable Energy Laboratory, Solar Position Algorithm for Solar Radiation Applications (NREL/TP-560-34302); NOAA Global Monitoring Laboratory, NOAA Solar Calculator: General Solar Position Calculations; Meeus, J., Willmann-Bell, Astronomical Algorithms

Something look off?

Your values

Showing an example. Change anything.
More options 1
Run many at once from a CSV

Loading…

How we got thisFormula, worked example, sources, and proof

Model: Geometric sun from the NREL Solar Position Algorithm; each crossing found by bisection between the day's highest and lowest points, which also decide polar states; sunrise and sunset at −0.833° (minus horizon dip when a height is given); solar noon from the NOAA equation of time

Show your work

  1. Solar noon

    when the sun crosses this longitude's meridian

    at -104.9903° longitude = 2026-06-21 13:02 local (2026-06-21 1902Z)

  2. Sunrise altitude

    −0.8333° for the sun's radius and refraction, less the dip from height

    -0.833° − 0° of dip = -0.833°

  3. Sunrise

    the crossing of that altitude before solar noon

    at 39.7392°, -104.9903° = 2026-06-21 05:32 local (2026-06-21 1132Z)

The same steps an agent gets from the MCP server with explain: true.

Accuracy: Within 1 minute of USNO on 1,200 events (300 places and dates, 94% to the same minute), including twilights that graze their altitude

When to use this: Use this when you need the day's light: sunrise and sunset for a place and date, solar noon, the length of the day, and the three twilights, in local time and Zulu. It is the tool behind planning a flight, a survey, a shoot, or any outdoor work that has to finish before the light goes.

Limitations: The times are for a level horizon at sea level: hills, a valley, or a tall building move sunrise and sunset by minutes, and refraction near the horizon varies with the weather. Inside the polar circles the sun may not rise or set at all, which the result states rather than inventing a time for. Legal twilight comes from the Air Almanac.

Worked example: Denver on the June solstice (MDT, UTC−6). Source: add-practitioner-essentials scenario: evening events after 00:00Z are dated on the next UTC day. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.

You enter

Local date
2026-06-21
Latitude
39.7392 deg
Longitude
-104.9903 deg
Time zone or UTC offset
-06:00

You get

Sunrise
2026-06-21 05:32 local (2026-06-21 1132Z)
Sunset
2026-06-21 20:31 local (2026-06-22 0231Z)
Solar noon
2026-06-21 13:02 local (2026-06-21 1902Z)
Day length
14 h 59 min
Civil dawn
2026-06-21 05:00 local (2026-06-21 1100Z)
Civil dusk
2026-06-21 21:04 local (2026-06-22 0304Z)
Nautical dawn
2026-06-21 04:18 local (2026-06-21 1018Z)
Nautical dusk
2026-06-21 21:46 local (2026-06-22 0346Z)
Astronomical dawn
2026-06-21 03:30 local (2026-06-21 0930Z)
Astronomical dusk
2026-06-21 22:34 local (2026-06-22 0434Z)
Day type
normal
Day length (minutes)
899

Review: Not yet independently reviewed by a geodesist.

Last verified: 2026-09-18, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.

Status: version 1.0.0, core 0.1.0. See this tool in the verification report.

Changes

Checked against: 21 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.

Sources

Terms

UTC: Coordinated Universal Time
The world's civil time standard, kept within 0.9 s of Earth's rotation by leap seconds. Aviation calls it Zulu time, written with a Z. Source: IERS Bulletin C (leap seconds)