Dr Phill’s Science Made Simple

Sun Rise, Sun Set, Moon Rise, and Moon Set Times

This page describes how to calculate the times of Sun Rise and Sun Set, and Moon Rise and Moon Set for any given day or location on Earth. The computation of the Sun and Moon times are similar.

There are several coordinate systems used for astronomical calculations. See the Coordinates page for details. Equatorial coordinates will be used for these calculations.

Four parameters are required.

The timezone needs to be converted to an offset \(tz\) from UTC in seconds. This offset can change if daylight saving time changes occur. The offset isn’t necessarily a whole number of hours. India spans three timezones and its offset is 5 hours 30 minutes ‘Asia/Kolkata’ = UTC+05:30.

The Julian date of mean solar noon for the location is calculated from the the Julian date of UTC noon and the timezone for the day.

\[J_n = J_m - \frac{tz}{86400}\]

The local day starts at \(J_0 = J_n - 0.5\) and ends at \(J_1 = J_n + 0.5\). Any event at time \(J\) occur in that day if \(J_0 \le J < J_1\).

The Julian date of solar noon \(J_s\) is the time of culmination of the Sun when it is at its highest in the sky. This is calculated from mean solar noon, the location’s longitude, and the Equation of Time \(E\) in minutes for the day.

\[J_s = J_n - \frac{\theta}{360} - \frac{E}{1440}\]

Sun Rise and Sun Set Calculations

In general, the times of Sun rise and Sun set are symmetrical about solar noon. This is not true of the polar region where there are days when the Sun never rises and there are days when the Sun never sets.

An additional parameter is required.

Calculate the declination \(\delta\) of the Sun at time \(J_s\).

Then, calculate the hour angle \(\omega\). This is the angular offset from the Sun’s position at solar noon and its position at Sun Rise and Sun Set. This is \(90^\circ\) at the equator and everywhere at the equinoxes.

\[\cos\omega = \frac{\sin\alpha - \sin\phi\sin\delta}{\cos\phi\cos\delta}\]

If \(|\cos\omega| > 1\) the the Sun doesn’t rise or set on that day. This happens in the Arctic and Antarctic circles in the months around the solstices.

The Julian Sun Rise and Sun Set times can be calculated.

\[J_{rise} = J_s - \omega/2\pi\] \[J_{set} = J_s + \omega/2\pi\]

The calculations will have some inaccuracy particularly at high latitudes. This is because the declination of the Sun is calculated at solar noon and changes over the day. The accuracy can be improved by iteration.

Repeat the calculations replacing \(J_s\) with the calculated value of \(J_{rise}\) when calculating \(\omega\) until it converges. Two iterations should be sufficient.

Repeat the calculations replacing \(J_s\) with the calculated value of \(J_{set}\) when calculating \(\omega\) until it converges. Two iterations should be sufficient.

Moon Phases

Moon phases are calculated from the elongation that is the moon’s right ascension minus the Sun’s right ascension \(e = \alpha_m - \alpha_s\). For a given day, calculate the elongation e1 at midnight at the start of the day and the elongation e2 at midnight at the end of the day. Both elongations must be in the range \([-\pi,\pi]\) Then the moon phases are:

In the northern hemisphere, each full Moon has a name based on the month. The names are Wolf, Snow, Worm, Pink, Flower, Strawberry, Buck, Sturgeon, Corn, Hunter’s, Beaver, and Cold. The full Moon in Septzber or October that is closest to the September equinox is also a Harvest Moon.

The timing of a New of Full Moon is based on the ecliptic longitude of the Sun \(\lambda_s\) and Moon \(\lambda_m\). The elongation \(e = \lambda_m - \lambda_s\). It is a New Moon when \(e = 0\) and a Full Moon when \(e = \pi\).

If the distance between the centre of the Earth and the centre of the Moon for New or Full Moon is closer than 360,000km then is is a Super Moon. If the distance is greater than 405,000km then is is a Micro Moon.

There are two definitions of a Blue Moon. The first is the second Full Moon in a calendar month. The second is the third Full Moon in a season that has four Full Moons. Each season starts on an equinox or solstice and ends on the next solstice or equinox.

Moon Rise and Moon Set

Moon Rise and Moon Set calculations are similar to Sun Rise and Sun Set calculations. There are however some important differences.

Lunar Culmination

The rise and set times are calculated as offsets from the time of culmination when the moon passes the meridian of the observer. The culmination times vary with the moon phases. They are approximately:

On days when Moon set is before Moon rise, the Moon set time is calculated from the meridian passing time of the day before. As the time between successive meridian passings is about 24 hours and 40 minutes, there is one day each month when there is no meridian passing.

The calculation of the meridian passing time \(J_M\) requires iteration as the moon moves through an angle of about \(12^\circ\) per day. Culmination occurs about 40 minutes later each day.

Calculate the right ascension \(\alpha_s\) of the Sun from the Earth at time \(J_s\).

Around the time of the Full Moon, the meridian passing time will be very close to midnight. It may not be possible to determine the passing time taking each day in isolation.

The issue can be resolved using the previous meridian passing time \(J^-\).

  1. Calculate the right ascension \(\alpha_m\) of the Moon from The Earth at time \(J_s\).
  2. Calculate the difference in right ascension between the Moon and the Sun \(\alpha = \alpha_m - \alpha_s\).
  3. Ensure that \(-\pi < \alpha \le \pi\) by adding or subtracting \(2\pi\) if out of range.
  4. Calculate the meridian passing time \(J = J_s \alpha/2\pi\).
  5. Resolve the midnight issue.

As the Moon is moving quite fast and the Earth is rotating, the calculated meridian times will be quite accurate around New Moon and get worse. This can be corrected by iteration. Repeat the computation calculating the Moon right ascesnsion at the last calculated meridian passing time instead of at solar noon. Two or three iterations will be sufficient.

Lunar Parallax

The position of the Moon for an observer on the surface of the Earth will be different from the position of an imaginary observer at the centre of the Earth. This is Luna Parallax. It will be significant when the Moon is low in the sky at Moon rise and Moon set.

Lunax Parallax

The radius of the Earth is \(R_e\) and the distance between centre of the Earth and the centre of the Moon is \(r_m\).

The latitude of the observer at \(O\) is \(\phi = \widehat{XEO}\). The declination of the Moon is \(\delta = \widehat{XEM}\). The angle \(\phi' = \widehat{MEO} = \phi - \delta\). The angle \(\delta'\) is the declination of the Moon as seen from the observer due to parallax. We can calculate distances and angles from the geometry of the triangles.

\[\widehat{EO'} = x_1 = R_e\cos\phi\] \[\widehat{EX} = x_1 + x = r_m\cos\delta\] \[\widehat{XM} = y + y_1 = r_m\sin\delta\] \[\widehat{OO'} = \widehat{XY} = y_1 = R_e\sin\phi\]

\[x = r_m\cos\delta - R_e\cos\phi\] \[y = r_m\sin\delta - R_e\sin\phi\] \[\tan\delta' = \frac{r_m\sin\delta - R_e\sin\phi}{r_m\cos\delta - R_e\cos\phi}\]

The parallax angle is:

\[d\delta = \delta - \delta'\]

First Moon Rise

First Moon rise is when the Moon rises in the morning and there is a Moon set later in the same day. These happen from a few days before last quarter and a few days before first quarter. On these days the Meridian passing is between 06h00 and 17h00.

The calculation is similar to Sun rise calculations.

Calculate the declination \(\delta\) of the Moon at Meridian passing time \(J_m\). Calculate the parallax angle \(d\delta\). We also need the altitude of the Lunar disc \(-0.583^\circ\).

\[\alpha = -0.583*\pi/180 - d\delta\]

Then, calculate the hour angle \(\omega\). This is the angular offset from the Moon’s position at Meridian passing and its position at Moon Rise. This is \(90^\circ\) at the equator and everywhere at the equinoxes.

\[\cos\omega = \frac{\sin\alpha - \sin\phi\sin\delta}{\cos\phi\cos\delta}\]

The Moon rise time is:

\[J_{rise} = J_m - \omega/2\pi\]

Iteration is required as the Moon moves during the period from meridian passing to Moon rise. On each iteration, recalculate \(\delta\) and \(d\delta\) using the prevously calculated rise time. Iteration stops when the differences between calculated rise times is less than a Julian minute \(|J_{rise} - J'_{rise}| < 1/1440\).

Moon Set

The Moon set calculations are the same as for Moon rise except that for the set time, the \(\omega\) term is added.

\[J_{set} = J_m + \omega/2\pi\]

Second Moon Rise

When displaying Moon rise and Moon set tables, it is better to have two Moon rise columns as in a giben day Moon rise can be before or after Moon set. If \(J_{rise} > J_{set}\) move it to the third column.

Moon Rise and Set Timing Issues

Moon timing are complicated by the fact that we like to see Moon rise and Moon set timings on a daily basis. The Moon doesn’t follow a daily pattern, to the calculations need to be modified at certain times of the lunar month.

A few days before the Last Quarter there is no Moon rise. The reason for this is that the Moon rise was late the previous day. There is a Moon set in the morning. When the Moon rise calculation produces a time before 00h00 it must be discarded.

For the next 12 or so days, which includes the New Moon, Moon rise is in the morning and Moon set is later the same day. The calculations work as expected.

A few days before first quarter, there is a day when the Moon rises in the morning, but doesn’t set. The reason being that the Moon set time is in the early hours of the next day. When the Moon set calculation produces a time after 23:59 it must be discarded.

The calculation are more complex for the remainder of the lunar month.

For the next 7 or 8 days, the Meridian passing time is late in the day. The Moon rise calculations are still calculated as described above. It will be displayed in the second Moon rise column. Moon set occurs before Moon rise on these days and the Moon rise calculations need to be modified. If Meridian passing time is after local noon and the calculated Moon set time is after 23h59 then the Moon set calculation needs to be repeated using the previous day’s Meridian passing time!

A few days before Full Moon, there is a day when there is no Meridian passing. On this day Moon set must be calculated using the previous day’s Meridian passing time. The Moon rise time must be calculated using the next day Meridian passing time.

For the next 7 or so days around the Full Moon the Moon rise calculations need to be modified. If Meridian passing time is before local noon and the calculated Moon set time is before 00h00 then the Moon rise calculation needs to be repeated using the next day’s Meridian passing time!