Sunrise, Sunset, and Civil Twilight
NOAA solar-position algorithm: sunrise, sunset, civil / nautical / astronomical twilight, daylight minutes.
Example
You enter
- Latitude (deg) 40
- Longitude (deg) -105
- Date (YYYY-MM-DD) 2026-06-21
- Timezone offset (hr) -6
You get
- Declination 23.45 deg
- Daylight 901 min
- Sunrise 05:30
- Sunset 20:31
Checked against published worked examples from: NOAA Solar Position Algorithm (SPA, project bundled).
Details, formula, and sources
Formula or tableNOAA's General Solar Position Calculations (the fractional-year Fourier series for declination and the equation of time) give sunrise / sunset / civil / nautical / astronomical twilight from latitude / longitude / date, with the sun's center at zenith 90.833° for sunrise and sunset.
Source and editionNOAA Solar Calculator (Global Monitoring Laboratory), its General Solar Position Calculations, by name. Not the NREL Solar Position Algorithm (Reda & Andreas), which is far more precise.
Free accessFree at gml.noaa.gov/grad/solcalc.
What governsGeometry is not forecasting. Avalanche advisory and incident commander govern.
API field nameslat_deg, lon_deg, date_iso, tz_offset_hours, declination_deg, daylight_minutes, sunrise, sunset
- Atmospheric refraction −0.833° standard at horizonNOAA General Solar Position Calculations