Sunrise Sunset Calculator

Created by Krishna Nelaturu
Last updated: Nov 05, 2022

Our sunrise-sunset calculator will help you estimate a location's sunrise and sunset time based on its latitude. As a bonus, you can also calculate the daylight hours of the area. These calculations require a good understanding of the Earth's rotation as it orbits around the Sun, starting with the fact that it is spherical (NOT FLAT!). Learn how to do these calculations yourself by going through the article below.

We also discussed another phenomenon related to Earth's rotation in the Coriolis effect calculator. Be sure to check it!

Sunrise and sunset

The sunrise is the first time the Sun appears over the horizon in the morning, marking the start of a new day. The sunset, on the other hand, marks the end of the day when the Sun disappears below the horizon in the evening.

Both sunrise and sunset times can vary significantly at different latitudes on Earth. This is because factors like the angle of the Earth's rotation relative to the Sun, the height of the Sun above the horizon, and local geography can all affect the timing and duration of these important events.

💡 Our Earth curvature calculator will prove a great read for our users inclined to understand the term horizon better.

One factor affecting sunrise and sunset times is the proximity to the equator. At latitudes closer to the equator, the Sun rises and sets at more constant points throughout the year since the Sun's path across the sky is more direct. In contrast, at latitudes further from the equator, there may be significant seasonal variations in the timing of sunrise and sunset as the Sun's path across the sky becomes more oblique during certain times of the year.

Calculating sunrise and sunset

The sunrise and sunset times are primarily dependent on two factors:

• The latitude of the location; and
• The day of the year.

Before calculating sunrise or sunset times, we introduce a new variable called the hour angle, given by:

$\omega = \mp \cos^{-1}\left(- \tan \varphi \tan \delta\right)$

Where:

• $\omega$ - The hour angle, negative for sunrise and positive for sunset;
• $\varphi$ - The latitude of the location in degrees; and
• $\delta$ - The declination angle.

This declination angle $\delta$ is the angle between the Equator and the line joining centers of Earth and the Sun, which varies every day. It is given by:

$\delta = 23.45 \cdot\sin \left( \left(284 + n\right) \frac{360}{365}\right)$

Where $n$ is the $n^{th}$ day of the year. For instance, January 1ˢᵗ is the 1ˢᵗ day of the year, and December 31ˢᵗ is the 365ᵗʰ day of a non-leap year.

Our trigonometric functions calculator can help you find the values of sine, cosine, and tangent functions.

Using the sunrise hour angle, we can find out the sunrise time at a location:

$\rm{sunrise \text{ } time} = 12 + \frac{\omega}{15}$

Remember that $\omega$ is negative for sunrise!

Similarly, we can find out the sunset time at a location from its hour angle:

$\rm{sunrise \text{ } time} = 12 + \frac{\omega}{15}$

Keep in mind that $\omega$ is positive for sunset!

Calculating daylight hours

The daylight hours at a latitude is given by:

\small\begin{align*} \rm {daylight \text{ } hours} &= \frac{2}{15} \cdot \cos^{-1}\left(- \tan \varphi \tan \delta\right)\\[1em] \rm {daylight \text{ } hours} &=\frac{2}{15} \cdot \omega \end{align*}

Our calculations thus far did not factor in atmospheric refraction, which makes the sun appear higher than its actual position. The following adjustment to the formula to calculate sunrise and sunset time will account for this phenomenon:

$\omega = \pm \cos^{-1} \left(\frac{\sin a - \sin\varphi \cos \delta}{\sin\varphi \cos \delta}\right)$

Where $a$ is the altitude angle, equal to $- 0.83\degree$.

How to use this sunrise sunset calculator

Our calculator requires only two inputs from you:

1. The day - click on the calendar 📅 icon in this sunrise-sunset calculator and select the date.
2. The latitude of the location.

Based on this, the sunrise-sunset calculator will provide you with the following results adjusted for atmospheric refraction:

• Sunrise/sunset angles.
• Sunrise/sunset times.
• Hours of daylight by latitude.

Clicking on the advanced mode button will give you these results without the adjustment for atmospheric refraction.

Krishna Nelaturu
Day
Latitude (φ)
deg
Day of the year
341
Declination angle (δ)
-22.8
deg
w/ Atmospheric refraction
Sunrise/Sunset angle (ω) ∓
deg
Sunrise time
hrs
min
Sunset time
hrs
min
Daylight hours
hrs
min
People also viewed…

Parallax

Use the parallax calculator to determine the distance between the earth and the stars.

Rocket thrust

Learn how to calculate the thrust of a rocket with our handy tool.