Calculadora de Nascer e Pôr do Sol
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
H = acos(−tan(lat)·tan(δ)); nascer = 12 − H/15
About this calculator
This calculator estimates sunrise and sunset times, as well as day length, for any location on Earth. You provide the latitude (in degrees) and the day of the year (1 to 365). The calculation considers solar declination, which varies with seasons, and uses a trigonometric formula to determine the hour angle of sunset. The result is approximate, as it ignores atmospheric refraction and the Sun's disk size.
The main formula is: H = arccos(-tan(latitude) * tan(declination)). Sunrise occurs when the Sun's center is at the horizon, calculated as 12 - H/15 (in hours). Sunset is 12 + H/15. Day length is 2*H/15 hours. Solar declination is estimated from the day of year using a sinusoidal approximation. For latitudes above 66.5°, midnight sun or polar night may occur, indicated in the result.
Use this tool to plan outdoor activities such as photography, gardening, or travel. It helps to know when the sun rises or sets on a specific date, useful for scheduling or understanding seasonal light variation. Remember that the calculation does not consider local time zone: times are in True Solar Time (TST), which differs from official time. For better accuracy, adjust for your longitude and time zone.
Cautions: the formula assumes an observer at sea level and no horizon obstructions (mountains, buildings). At high latitudes, error may be larger due to refraction. Near equinoxes, results are more reliable. Do not use for navigation or situations requiring minute accuracy. For precise calculations, consult official astronomical ephemerides.
Frequently asked questions
Why do the calculated times differ from what I see on my phone?
The calculator uses True Solar Time, without time zone or daylight saving adjustments. Your phone shows official time, which may differ by up to 1 hour or more depending on longitude.
What does 'midnight sun' or 'polar night' mean?
Above the Arctic or Antarctic Circle, the sun may not set (midnight sun) or not rise (polar night) at certain times. The calculator indicates this when H cannot be computed.
Does altitude affect the result?
Yes, but the calculator assumes sea level. At higher elevations, sunrise occurs slightly earlier and sunset later, due to Earth's curvature.
Can I use it for any date of the year?
Yes, from 1 to 365. For leap years, use 366 for December 31. Accuracy is lower for days very close to the winter solstice at high latitudes.
What latitude should I use for my city?
Use the approximate latitude. For example, New York: 40.7°, London: 51.5°, Tokyo: 35.7°. For the southern hemisphere, use negative values.