applets.

Sun Clock

← All apps

About Sun Clock

Where is the sun? Pick a place, type a latitude, longitude and time zone, or press MY LOCATION (your browser asks first and nothing is sent anywhere), then a date and a clock time, and the almanac page gives the sun's height above the horizon, its bearing, its declination and the equation of time; then sunrise, solar noon, sunset, the length of the day and the three twilights, with the week ahead underneath. Drag the sliders through the day or the year, or press ▶ DAY or ▶ YEAR to run through them (■ PAUSE stops, ▶ RESUME carries on). NOW sets your computer's present moment, seen at that place. Nothing about where you are is asked for or sent anywhere.

SKY is the whole horizon, laid out flat: today's path of the sun with the hours marked, the paths at the two solstices and the equinox, and the bands of twilight below the horizon. SUNDIAL is a horizontal garden dial made for the latitude, with the gnomon's shadow, and the sum that turns its reading into clock time. EQUATION OF TIME charts how far a sundial runs ahead of or behind an even clock through the year, and its two causes. ANALEMMA is where the sun stands at the same clock time every day of the year. DAY LENGTH compares a year of days from the equator to beyond the Arctic Circle.

Time zones are fixed standard offsets, and summer time is simplified: AUTO uses a whole-day version of the usual rule for that region (European, North American, south-east Australian or New Zealand), not the exact hour of the change, and it ignores the many times governments have changed the rules. ON and OFF override it.

This app grew from the Python script Clock.py, which prints the time once a second, faithfully, for as long as you let it. Sun Clock asks where that time comes from.

THE STORY

Shadow clocks were in use in ancient Egypt more than 3,000 years ago, and for most of history a day's hours were measured by the sun. Early dials divided the daylight into twelve, so an hour was longer in summer than in winter. Equal hours all year need a style parallel to the Earth's axis, pointing at the celestial pole; that spread in the late Middle Ages, and one of the earliest known is on the great dial Ibn al-Shatir made for the Umayyad Mosque in Damascus in 1371.

Once pendulum clocks kept good time, in the 1660s, it was clear that the sun does not: a sundial and a good clock drift apart by up to a quarter of an hour and back again through the year. Christiaan Huygens printed a table of the difference for setting clocks by the sun, and in the early 1670s John Flamsteed explained its two causes. Towns kept their own local time until the railways needed one: Bristol, about 2½° west of Greenwich, ran some ten minutes behind London, and the clock on its Corn Exchange still has two minute hands. Greenwich Mean Time became the legal time in Great Britain in 1880. British Summer Time began in 1916, after years of campaigning by the builder William Willett.

HOW IT WORKS

The sun's position uses the method of the solar calculator of the US National Oceanic and Atmospheric Administration, which follows Jean Meeus's Astronomical Algorithms (1991). From the date it works out where the Earth is on its slightly oval orbit, the sun's longitude along the ecliptic, its declination (how far north or south of the equator it stands) and the equation of time; then, from the hour angle and the latitude, its altitude and azimuth. Near the horizon the air bends sunlight upward, so a standard allowance for refraction is added. The method is good to about a minute for places between 72° north and south; nearer the poles, where the sun skims the horizon, sunrise and sunset times can be several minutes out.

Sunrise and sunset are when the top of the sun touches a flat horizon: its centre is then 0.833° below it (about 34′ of refraction plus the sun's half-width of 16′). Civil, nautical and astronomical twilight end when the centre is 6°, 12° and 18° down. Each time is found by working out the hour angle at which the sun reaches that height, then repeating with the sun's position at that time until it settles. Hills, buildings and the weather are not included.

The equation of time has two causes. The orbit is an ellipse, so the Earth moves fastest in early January and slowest in early July: the true sun runs ahead of or behind an imaginary sun that moves evenly (about ±7.7 minutes, once a year). And the Earth's axis is tilted 23.4°: even if the sun moved evenly along the ecliptic, its east–west progress, which is what a sundial measures, is quicker at the solstices and slower at the equinoxes (about ±9.9 minutes, twice a year). Added together they give the odd curve, from +16.5 minutes in early November to −14.2 in mid February.

A horizontal sundial has its style at an angle equal to the latitude, so it lies parallel to the Earth's axis. The hour line h hours from noon makes an angle θ with the noon line, where tan θ = sin(latitude) × tan(15° × h). The dial shows local apparent solar time; to get clock time, take off the equation of time, add 4 minutes for each degree you are west of the time zone's own meridian (take them off if east), and add an hour for summer time. Near the equator a horizontal dial works badly (the style lies almost flat and the hours crowd together), so dials there are usually built upright or as rings.

The analemma is the sun photographed at the same clock time all year. Its height swings with the seasons (the declination, ±23.4°), and it slides east and west with the equation of time, so it draws a figure eight with unequal loops: the two causes have different periods. The page uses standard time all year, or summer time would split it in two.

FURTHER WATCHING AND READING

Place
Date
Clock time
Summer time

The Sun

Sunrise
Sunset
Solar noon
Day length
Altitude
Bearing
Declination
Eq. of time

Twilight

Sun belowdawndusk
18° astronomical
12° nautical
6° civil

The days ahead

DateSunriseSunsetDayChange