Sunrise/Sunset Technical Notes
How accurate are the results?
Between the years 1900 and 2100 A.D. and between latitudes 80° N
and 80° S, the results are accurate to the minute. Between the
years 1600 and 1900, or between 2100 and 2400, the results should be
accurate to within two or three minutes. (In order to maintain this level of
accuracy, the program must account for atmospheric refraction, geocentric
parallax, precession, nutation and aberration. The solar system is a bit
more complex than most people think.)
Why don't you report results for the polar regions (North of
80° N or South of 80° S)?
There are two reasons for this. The first is that when calculating the time
of sunrise or sunset for the polar regions, very small inaccuracies in the
calculation of the sun's ecliptic longitude result in large errors in the
time of sunrise or sunset. The second is that the length of the day varies
considerably in the polar regions. In this part of the world, one should
fast for twelve hours, from 6:00 in the morning to 6:00 in the evening. As
"note 17" from the Kitáb-i-Aqdas says:
In regions where the days and nights grow long, let times of prayer
be gauged by clocks and other instruments that mark the passage of the
This refers to territories situated in the extreme north or south, where the
duration of days and nights varies markedly. This provision applies also to
Why don't you report results for before 1600 A.D. (or after 2400 A.D.)?
The orbit of the Earth around the Sun is almost a perfect ellipse, but not
quite. If it were, it would be trivial to determine the time of sunrise or
sunset far into the future (or past). The Earth's orbit, however, is
slightly perturbed by the gravitational influences of the moon and other
planets. This causes the shape of the orbital ellipse, and the ecliptic
angle of the Earth's rotational axis, to change slowly with time.
The largest of these factors is the gravitational effect of the moon, which
is known as nutation. The program does take this into account, but it
ignores the much smaller perturbations caused by the other planets. After
hundreds of years, however, these effects accumulate and compromise the
accuracy of the calculations.
When I look out my window, the sun doesn't rise (or set) exactly when
your program states it will. Why not?
The biggest reason for discrepancies is the elevation of the observer. If
you are located on top of a hill (or in a tall apartment building), the sun
indeed will rise earlier and set later than calculated. If you are located
at the bottom of a valley, it will rise later and set earlier. The program
can not make allowances for your local topography. It assumes that the earth
is a smooth, featureless sphere.
Another possible cause for a difference is the use of inaccurate
coordinates. The difference of even one degree of longitude results in a
difference of four minutes of time.
Finally, unusual atmospheric conditions can cause the time of rising or
setting to fluctuate by as much as 72 seconds.
How did you figure this out?
The program is based on the book Astronomical Algorithms written by
the astronomer Jean Meeus. It is available from
Return to Sunrise & Sunset