Sunrise Sunset Calculator

Created by Rahul Dhari
Reviewed by Steven Wooding
Last updated: Nov 29, 2021

The sunrise sunset calculator will assist you in determining the sunrise and sunset times for a particular day for all populated latitudes. The Earth rotates at an angular velocity of 15°/hour; therefore, there is a need for a formula to calculate sunrise and sunset based on the location. The sunrise and sunset times are a function of location and day of the year. Based on these timings, the calculator also estimates how many hours of daylight a place would receive.

Read on to understand what time is sunrise and sunset today? Or you want to know how to calculate sunrise and sunset time based on the formula.

Sunrise and Sunset times

The term sunrise time refers to the time when the sun first appears or when daylight has arrived. Similarly, sunset time is defined as the time when the sun disappears below the horizon. For a given location having latitude φ° and nthn^{th} day of the year, the sunrise time can be estimated using the hour angle for sunrise/sunset, ω\omega.

ω=cos1(tanφtanδ)\omega = \mp \cos^{-1}( -\tanφ \tan δ )

Where δ is the declination angle. The sunrise angle is negative, whereas the sunset angle is positive. The declination angle is the angle between the equator and the line joining centers of Earth and sun. The angle of declination varies with each day, n such that:

δ=23.45sin((284+n)360365)δ = 23.45 \sin ( (284 + n)*\frac{360}{365} )

where n is the nthn^{th} day of the year. The declination angle has several formulae for estimation, the above approximation is based on the work of P.I. Cooper from the year 1969.

Definition of solar angles.
Hour angle, h, Latitude, Φ , and declination angle, 𝛿.

Once we have the hour angle for sunrise, ω\omega, it is added (negative) from the solar noon to determine the sunrise time.

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

The sunset hour angle ω\omega is the negative of the sunrise hour angle or positive. The sunset time is then estimated by adding it to the solar noon:

sunset time=12+ω15\text{sunset time} = 12 + \frac{\omega}{15}

The above equations are formulae to calculate sunrise and sunset times. Once we know the timings, we can determine the hours of daylight for a latitude using the equation:

Daylight hrs=215cos1(tanφtanδ)\scriptsize \text{Daylight hrs} = \frac{2}{15} * \cos^{-1} (- \tan φ * \tan δ)

Alternatively, the daylight hours equation can also be written as:

Daylight hrs=215Sunset angle\small \text{Daylight hrs} = \frac{2}{15} * \text{Sunset angle}

While the above methodology is correct, it does not take into account atmospheric refraction. This effect occurs due to the sunlight refracting through the atmosphere and making the sun appear higher above the horizon than its actual position. A variable sin(a) is included in the sunrise and sunset formula to take this phenomenon into account. Therefore, the corrected sunset and sunrise equation is:

ω=±cos1sinasinφcosδsinφcosδ\omega = \pm \cos^{-1} {\frac {\sin a - \sin φ \cos δ } { \sin φ \cos δ } }

Where a is the altitude angle having the value of -0.83°.

How to calculate the times of sunrise and sunset for tomorrow?

To calculate sunrise and sunset times:

  1. Enter the date for tomorrow.
  2. Fill in the latitude for your location (use positive for °N and negative for °S).
  3. The calculator will return the declination angle for the date and subsequently calculate the sunrise and sunset times for the particular day.
  4. The tool will also return how many hours of daylight you will receive.

By default, the calculator shows you results taking into account atmospheric refraction. To see the uncorrected results, active the Advanced mode of the calculator.

Example: Using the sunrise sunset calculator

When are sunrise and sunset today, given the date is 15th March? Also, find out how many hours of daylight there is on that date? Take location as 45 °N.

To know what time is sunrise and sunset today:

  1. Pick the date for today as 15th March.
  2. Enter the latitude as 45°.
  3. The declination angle is returned as:
δ=23.45sin((284+75)360365)=2.82°\scriptsize \qquad \begin{align*} δ &= 23.45 * \sin ( (284 + 75)*\frac{360}{365} ) \\ &= -2.82° \end{align*}
  1. Using the sunrise equation:
ω=cos1(tan40tan2.82)=87.2°\scriptsize \qquad \begin{align*} ω &= \mp \cos^{-1}( -\tan 40 * \tan -2.82 ) \\ &= -87.2° \end{align*}

and sunrise time is:
12 - 87.6/15 = 6:09 am.

  1. Similarly, the sunset time is:
    12 + 87.6/15 = 5:50 pm.
  1. Considering atmospheric refraction, the sunrise and sunset hour angles become:
ω=cos1(sin0.83sin40cos2.42sin40cos2.42)=88.4°\scriptsize \quad \begin{align*} \omega &= \mp \cos^{-1}( \frac{ \sin -0.83 - \sin 40 \cos -2.42 } { \sin 40 \cos -2.42 } ) \\ &= \mp 88.4° \end{align*}
  1. The sunrise and sunset times are: 6:04 am and 5:55 pm local time.

The atmosphere refraction has set the sunrise time 5 minutes early based on the appearance of the first light and pushed the sunset time by 5 minutes, increasing the daylight hours by 10 minutes for a day.


Duffie, John A., and William A. Beckman. “Fundamentals.” Introduction. In Solar Engineering of Thermal Processes, 1–25. Hoboken, NJ: Wiley, 2013.

Kalogirou, Soteris. “Environmental Characteristics.” Essay. In Solar Energy Engineering: Processes and Systems, 49–71. Oxford, UK: Academic Press, 2014.


What is atmospheric refraction?

The phenomenon that celestial objects appear higher above the horizon than they actually are is known as atmospheric refraction. This occurs because of the refraction of light reflected from the objects by the atmosphere.

What is the angular velocity of earth?

The earth rotates with an angular velocity of 15° per hour.

How do I calculate sunrise hour angle?

To calculate sunrise hour angle:

  1. Find the latitude and day of the year, n.
  2. Estimate the declination angle using the equation:
    δ = 23.45 * sin((284 + n) * 360/365).
  3. Multiply the tangents of latitude and declination angle.
  4. Find the cosecant inverse for the negative of the product.
  5. Multiply the resultant with -1 to get the hour angle for sunrise.

How do I calculate daylight hours?

To calculate daylight hours for today:

  1. Multiply 2 by the sunrise or sunset angle.
  2. Divide the product with 15 to get the daylight hours.
    Daylight hours = 2/15 * sunrise angle
Rahul Dhari
Latitude (φ)
Day of the year
Declination angle (δ)
w/ Atmospheric refraction
Sunrise/Sunset angle (ω) ∓
Sunrise time
Sunset time
Daylight hours
Check out 18 similar astrophysics calculators 🌌
Alien civilizationBlack Hole Collision CalculatorBlack hole temperature… 15 more
People also viewed…

Grams to cc

This grams to cc converter helps you quickly calculate the volume out of mass and density.

Sensible heat

Determine the heat required to change an object's temperature using our sensible heat calculator.

Social Media Time Alternatives

Check what you could have accomplished if you get out of your social media bubble.

Steps to calories

Steps to calories calculator helps you to estimate the total amount to calories burned while walking.
Copyright by Omni Calculator sp. z o.o.
Privacy policy & cookies
main background