How Accurate Are Published Sunset Times?

We measured ours against the US Naval Observatory. We also measured everyone else's, and found a bug that has been quietly propagating for thirty years.

Every site that publishes sunset times claims to be accurate. Almost none of them show their working, and as far as we can find, none publishes a comparison against a reference.

So we did that, and the results are more interesting than expected.

What we measured against

The US Naval Observatory is the reference. It is the body that has computed rise and set times for the United States since the nineteenth century, and its published values are what everything else is ultimately checked against.

We took fifteen locations spanning latitude 54.8°S to 78.2°N, on dates covering both solstices, both equinoxes, a daylight-saving changeover and a half-hour time zone, and compared every sunrise, sunset and civil twilight boundary.

Every sunrise and sunset in the validation set, against the US Naval Observatory. Worst disagreement: 34 seconds. USNO publishes to the minute, so up to 30 seconds of each figure is its own rounding.
LocationDateUSNOThis siteDifference
New York2026-08-24sunrise 06:1506:15:13+13 s
New York2026-08-24sunset 19:4119:40:47-13 s
London2026-08-25sunrise 06:0206:01:44-16 s
London2026-08-25sunset 20:0220:02:24+24 s
Sydney2026-06-21sunrise 07:0007:00:00+0 s
Sydney2026-06-21sunset 16:5416:53:47-13 s
Quito2026-03-20sunrise 06:1806:17:54-6 s
Quito2026-03-20sunset 18:2418:24:34+34 s
Reykjavik2026-06-21sunrise 02:5502:55:15+15 s
Reykjavik2026-06-21sunset 00:0400:03:56-4 s
Tromso2026-06-21midnight sunmidnight sunmatch
Tromso2026-12-21polar nightpolar nightmatch
Longyearbyen2026-12-21polar nightpolar nightmatch
Longyearbyen2026-06-21midnight sunmidnight sunmatch
Singapore2026-09-23sunrise 06:5406:53:53-7 s
Singapore2026-09-23sunset 19:0019:00:32+32 s
Cape Town2026-12-21sunrise 05:3205:31:58-2 s
Cape Town2026-12-21sunset 19:5719:56:45-15 s
Anchorage2026-01-15sunrise 09:5609:56:29+29 s
Anchorage2026-01-15sunset 16:2216:22:24+24 s
Ushuaia2026-06-21sunrise 09:5909:58:53-7 s
Ushuaia2026-06-21sunset 17:1117:11:16+16 s
Nairobi2026-11-05sunrise 06:1106:11:20+20 s
Nairobi2026-11-05sunset 18:2118:21:11+11 s
Kathmandu2026-04-10sunrise 05:4505:44:35-25 s
Kathmandu2026-04-10sunset 18:2618:25:57-3 s

USNO publishes to the minute, so up to 30 seconds of each difference above is its own rounding rather than ours. The true error is smaller than the figures shown.

What we found in other implementations

While setting this up, something did not add up.

The reference values named in our own project specification came from sunrise-sunset.org, one of the most widely used sunset sites. For New York on 24 August 2026 it gives sunrise at 6:14:07 and sunset at 7:42:33 pm. USNO gives 6:15 and 19:41. Open-Meteo gives 6:15 and 19:40.

So sunrise-sunset.org is about a minute early on sunrise and a minute and a half late on sunset — but its solar noon and its civil twilight times match USNO exactly, to the second.

That asymmetry is a fingerprint. If a solar position model were simply inaccurate, everything would drift together. Noon and twilight being exact while sunrise and sunset are symmetrically wrong means the model is fine and the threshold for sunrise and sunset is wrong.

Tracing it

PHP's deprecated date_sunrise() function, at its default zenith of 90.8333 degrees, returns 6:14:07 and 7:42:33 pm for the same inputs. Not close to sunrise-sunset.org — identical, to the second.

Both descend from sunriset.c, Paul Schlyter's widely copied C implementation from the 1990s. That code takes an upper_limb flag, and when it is set it subtracts the sun's apparent radius from the altitude threshold:

if (upper_limb) altit -= sradius;

The problem is what it subtracts it from. The standard sunrise altitude of −0.833 degrees is already the upper-limb value: it is 34 arcminutes of atmospheric refraction plus 16 arcminutes of solar semi-diameter, added together. Subtracting the semi-diameter again gives roughly −1.1 degrees, and the sun takes about 86 extra seconds to reach it.

The day comes out about 172 seconds too long, split evenly either side of a correct solar noon. Which is exactly the pattern in the measurements.

This is not a criticism of Schlyter's code, which is clear about what the flag does. It is what happens when a flag with a specific meaning gets enabled by downstream users who assume it is required, on top of a constant that already includes the correction. Thirty years of copying later, it is in a great deal of software.

What actually limits accuracy

Even with the arithmetic right, there is a floor, and it is not in the astronomy.

Refraction is weather. The −0.833 degree figure assumes a standard atmosphere: 1013 hPa, 10°C, an ordinary temperature profile. Real refraction near the horizon varies with pressure, temperature and especially the temperature gradient in the lowest few metres of air. Over cold water with warm air above, the sun can appear minutes after it has geometrically set. Tens of seconds of variation is normal; minutes are possible.

No published table can account for this, because it depends on conditions at your location at that moment. It is the reason we do not chase precision beyond the second: the number would be false precision.

The horizon is rarely at sea level. Published times assume a flat horizon at your altitude. A mountain to the west takes the sun away early; standing on a hill gives you extra. We compute for a sea-level horizon, which is what USNO publishes and what makes our figures comparable to everyone else's — and we show elevation separately on each city page, with the amount it would add if you had a clear horizon. In La Paz at 3,782 m that is about nine minutes.

Coordinates matter more than people expect. A city is not a point. At mid-latitudes, one degree of longitude is four minutes of solar time, and a large city can span a tenth of that. We use the GeoNames coordinate for the city centre and state it on every page.

What we do

Checking us

Everything above is reproducible. tests/test_sun.php runs the comparison against fixtures fetched from the USNO API, and the fixture file records what USNO returned. If you find a disagreement we have not accounted for, tell us — the city, the date, the value you expected and the source. That is enough to reproduce it.

The honest summary: our times agree with the US Naval Observatory to within about half a minute, most of which is USNO's own rounding. The atmosphere will move the real event by more than that on any given evening, and no published time can fix it.

Times for your own city Every figure in this article is computed for 733 cities, each with its own page.