Sun position, not just clock hands

Using SunCalc, the sundial calculates the Sun’s position from the date, device time, latitude and longitude. Altitude is the angle above the horizon; azimuth is the compass direction. A virtual vertical pin casts its shadow away from the Sun onto a horizontal dial. This is not a traditional gnomon aligned with Earth’s axis.

A little trigonometry

For pin height H and solar altitude α, shadow length on the horizontal plane is L = H / tan(α). A high Sun makes a short shadow; a low Sun makes a long one. Below the horizon, no solar shadow is shown. For readability, long shadows are clipped and very short ones enlarged: the visible length is not a scale measurement. Hour marks are calculated for the date and location; orientation also accounts for the southern hemisphere and the tropics.

Why two different times?

Apparent solar time follows the local Sun: its upper meridian transit marks solar noon. The code converts the solar hour angle into hours, at 15 degrees per hour. Flip digits instead show civil time in the selected time zone. Longitude, the equation of time and daylight saving can make the readings differ. Sunrise and sunset are calculated too and shown in the selected zone; during polar day or night, those events may not occur.

Try it with deliberate location permission

Choose Sundial, enable Location-based simulation and allow location access in your browser. The clock calculates the solar position locally and keeps location in memory for this visit only. Rounded coordinates are sent through the backend to a paired streaming receiver only with the separate “Share sender location” opt-in. Position changes are tracked while the location mode is actively used. Your device time must be correct; the time zone remains a separate setting. This sundial is a visualization, not a precision instrument.

Try the clock ↗ · Instructions and more screenshots