Whether you are a photographer hunting the perfect golden-hour light, a gardener planning when to water, or a traveller checking sunset times for a rooftop dinner reservation, knowing exactly when the sun will rise and set at a specific place on a specific date is surprisingly hard to look up. This tool solves it entirely in your browser — no API, no network request, just pure trigonometry applied to your latitude, longitude and the date.
What you get
Enter a location and a date and the calculator returns seven precise solar events:
- Civil dawn — first usable daylight, 6° before sunrise
- Sunrise — upper limb of sun clears the horizon
- Golden hour end (morning) — sun reaches 6° altitude; warm directional light fades
- Solar noon — sun at its highest point; shadows are shortest
- Golden hour start (evening) — sun drops to 6° altitude; golden light returns
- Sunset — upper limb of sun touches the horizon
- Civil dusk — last usable daylight, 6° after sunset
You also get total day length (sunrise to sunset) and an interactive 24-hour day-arc diagram that shows the proportions of night, civil twilight, golden hour and full daylight at a glance.
How the formula works
The core of every solar calculator is the hour angle equation. Once you know the sun’s declination (its celestial latitude) and the observer’s latitude, you can work backwards from the desired solar zenith angle to find the time of day:
cos(HA) = (cos(z) − sin(lat) × sin(dec)) / (cos(lat) × cos(dec))
Where z is the target zenith angle (90.833° for sunrise — the extra 0.833° corrects for
standard atmospheric refraction and the sun’s angular radius), lat is your latitude and
dec is the sun’s declination on the chosen date.
Solving for HA gives the hour angle in degrees either side of solar noon. Converting that
to clock time requires the equation of time — a wobble of up to ±16 minutes per year
caused by Earth’s elliptical orbit and axial tilt — which the calculator also applies.
Worked example
Location: London (51.5074° N, −0.1278° E), Date: 21 June (summer solstice)
At the summer solstice the sun’s declination is approximately +23.44°. Substituting into the hour angle formula:
cos(HA) = (cos(90.833°) − sin(51.51°) × sin(23.44°)) / (cos(51.51°) × cos(23.44°))cos(HA) ≈ (−0.01454 − 0.7826 × 0.3979) / (0.6225 × 0.9174)cos(HA) ≈ −0.3257 / 0.5711 ≈ −0.5703HA ≈ 124.8°
Solar noon in London on 21 June is approximately 13:02 BST (accounting for longitude and equation of time). Adding and subtracting 124.8° × 4 min/° = 499 min ≈ 8 h 19 min:
- Sunrise: 13:02 − 8:19 = 04:43 BST
- Sunset: 13:02 + 8:19 = 21:21 BST
- Day length: 16 h 38 min — the longest day of the year
The calculator performs this calculation instantly for any latitude/longitude and date you enter.
Formula reference
| Event | Zenith angle used |
|---|---|
| Sunrise / Sunset | 90.833° (refraction + solar radius) |
| Civil twilight | 96° |
| Golden hour boundary | 84° (6° solar altitude) |
| Solar noon | Equation of time only (no hour angle) |
All intermediate results (Julian Day, mean anomaly, ecliptic longitude, obliquity, right ascension, declination, equation of time) follow Jean Meeus’s Astronomical Algorithms (2nd edition), the same source used by NASA and NOAA.