Solartime is a web application that displays key solar timing information based on your current location. Specifically, it provides:
- Local Solar Time – the actual time based on the Sun’s position in your sky (as a sundial would read).
- Sunrise and Sunset Times – the exact local clock times when the Sun rises and sets each day.
- Day Length – how long the Sun stays above the horizon each day.
- Day Length Change – the difference in daylight duration from one day to the next.
Solar time (apparent solar time) is computed from the current UTC time by applying two corrections:
- Equation of Time (EOT)
- Longitudinal Offset
The combined formula is:
Solartime calculates the Equation of Time from the Julian Day (JD) using:
where
Then the EOT in hours is:
- The numerator is in minutes, so division by 60 converts to hours.
- Positive
$\Delta t_{EOT}$ means solar time runs ahead of mean time; negative means it lags.
The longitudinal offset corrects for your position east or west of the prime meridian (UTC reference). Earth rotates 360° in 24 h (15°/h), so:
Longitudes east are positive (solar time ahead of UTC); west are negative.
Solartime finds sunrise and sunset by solving for the Sun’s hour angle when its center reaches an altitude of (-0.833°) (accounts for refraction and solar radius) via:
-
$\phi$ = observer’s latitude -
$\delta$ = solar declination (see below) $a = -0.833°$
Solar declination
- Compute days since J2000:
$n = JD - JD_{2000}$ - Mean anomaly in radians:
$g = \bigl(357.529 + 0.98560028\,n\bigr)\,\times\frac{\pi}{180}$ - Ecliptic longitude in radians:
$L = \bigl(280.459 + 0.98564736\,n + 1.915\sin g + 0.020\sin(2g)\bigr)\,\times\frac{\pi}{180}$ - Obliquity:
$\varepsilon = 23.439°\times\frac{\pi}{180}$ - Declination:
$\delta = \arcsin\bigl(\sin\varepsilon\,\sin L\bigr)$
This yields
Declination of the Sun on Wikipedia
To achieve sub-second accuracy, Solartime:
-
Initial guess uses
$\delta$ at midnight UTC to solve$\omega_0$ and get approximate rise/set times. -
Loop: at each approximate time
$t$ , recompute$JD$ as$JD + t/24$ , recalc$\delta$ , resolve$\omega_0$ , update$t$ . - Repeat until changes in (t) are below a tolerance (~0.0001 h ≈ 0.36 s) or after 6 iterations.
This method accounts for the declination’s daily change and yields precise sunrise and sunset times.
The standard angle of 90.833° from the zenith (i.e. (-0.833°) altitude) corrects for:
- Atmospheric Refraction (~0.57°)
- Solar Disk Radius (~0.27°)
Ensures calculated times match observed events at sea level.
Atmospheric Refraction on Wikipedia
Enjoy exploring daylight dynamics with Solartime!