1. Sunrise Is a Geometric Event, Not a Fixed Clock Time
Sunrise and sunset are defined by the apparent position of the Sun relative to an observer's local horizon. Their clock times change because Earth is rotating, orbiting the Sun on an ellipse, and maintaining an axial tilt of about 23.44°. Latitude, longitude, date, elevation, atmospheric conditions, time zone rules, and daylight-saving time all contribute to the final answer.
The calculation begins in an astronomical time scale rather than local civil time. A calendar date is converted to a Julian date, a continuous count of days used in astronomy. From that date, an algorithm estimates Earth's orbital position and the apparent geocentric position of the Sun. The key output is solar declination δ: the angular distance of the Sun north or south of Earth's celestial equator.
Near the June solstice, solar declination is approximately +23.44°, placing the Sun farthest north. Near the December solstice it approaches −23.44°. At the equinoxes it crosses 0°. This seasonal change explains why high northern latitudes receive long summer days and short winter days, while locations near the equator experience much smaller variations in daylight duration.
2. Solar Noon, the Equation of Time and Longitude
A simple clock assumes every solar day has exactly the same geometry, but the apparent Sun does not cross the local meridian at 12:00 civil time every day. The discrepancy between apparent solar time and mean solar time is called the equation of time.
Two effects create it. First, Earth's orbit is elliptical, so its orbital angular speed varies during the year according to Kepler's laws. Second, Earth's equator is tilted relative to the orbital plane, so uniform motion along the ecliptic does not project uniformly onto the celestial equator. Together these effects can shift apparent solar noon by more than a quarter of an hour from the mean value.
Longitude supplies another correction. Civil time zones cover broad geographic regions, but the Sun reaches the meridian progressively later as one travels west. In an ideal zone, every 15° of longitude corresponds to one hour. Political time-zone boundaries and daylight-saving rules then convert the computed UTC event into the local clock time shown to the user. For this reason, two cities at the same latitude can have similar day lengths but noticeably different sunrise clock times.
3. Solving the Sunrise Hour Angle
Once latitude φ and solar declination δ are known, spherical astronomy relates them to the solar hour angle H. For a chosen apparent solar altitude h₀, the standard equation is:
cos(H₀) = [sin(h₀) − sin(φ) · sin(δ)] / [cos(φ) · cos(δ)]
The positive solution gives the angular interval from solar noon to sunset; the negative solution gives the corresponding interval to sunrise. Because Earth rotates approximately 15° per hour, dividing the hour angle by 15 converts the angular interval into hours of apparent solar time. Approximate daylight duration is therefore 2H₀ / 15 hours.
The equation also explains polar day and polar night. If its right-hand side falls outside the mathematical range −1 to +1, there is no ordinary horizon crossing on that date. The Sun either remains above the horizon for the full rotation or never rises above it. A reliable calculator must detect this condition instead of forcing an invalid inverse cosine result.
4. Why Sunrise Uses −0.833° Instead of 0°
Published sunrise is normally the instant when the upper limb of the apparent solar disk reaches the horizon, not when the Sun's geometric center reaches altitude 0°. Practical algorithms commonly use a standard center altitude close to −0.833°.
This convention combines two effects. The Sun has an apparent angular radius of roughly 16 arcminutes, so its upper edge appears before its center. Atmospheric refraction near a clear, level horizon lifts the apparent image by roughly 34 arcminutes under standard conditions. Adding the two corrections gives approximately 50 arcminutes, or 0.833°.
Refraction is not perfectly predictable. Air pressure, temperature gradients, humidity, haze, terrain, buildings, and the true shape of the observer's horizon can shift an observed event by one or several minutes. Elevation can make sunrise earlier and sunset later because a raised observer sees a depressed geometric horizon. Therefore an algorithmic result is a standardized astronomical prediction, not a guarantee of the first visible photon at a particular landscape location.
5. Twilight and Golden Hour Are Altitude Bands
The same solar-position engine can calculate twilight and photographic light intervals by replacing the sunrise altitude with other thresholds. Civil twilight conventionally extends until the solar center reaches −6°. Nautical twilight extends from −6° to −12°, and astronomical twilight from −12° to −18°. Below −18°, scattered sunlight is usually weak enough for the sky to be considered astronomically dark under clear conditions.
Golden hour is less rigidly standardized. Photographic calculators commonly treat it as a band in which the Sun is close to the horizon, often from about −4° to +6°. The useful visual interval also depends on clouds, aerosols, terrain and the desired photographic effect.
This is why a city-specific solar calculator is more useful than a static seasonal table: it recomputes declination, hour angle and time conversion for the selected coordinates and date. The linked SkyMotion sunrise, sunset and golden-hour tools expose those results while keeping the assumptions visible to the reader.