What is the Daylight Duration Calculator?
This calculator estimates the number of daylight hours for any location, defined by its latitude, on a given day of the year. It uses the standard "sunrise equation" from solar geometry, combining your latitude with the Sun's declination angle for that date. The result is the time between sunrise and sunset (geometric daylight, ignoring atmospheric refraction and the apparent size of the Sun).
How to use it
Enter your latitude in degrees — positive for the Northern Hemisphere and negative for the Southern Hemisphere. Then enter the day of the year (1 = January 1, 172 ≈ June 21, 355 ≈ December 21). The calculator returns the daylight length in decimal hours and in hours and minutes, along with the computed solar declination for that day.
The formula explained
First the solar declination \(\delta\) is found with Cooper's equation: $$\delta = 23.45^{\circ}\sin\!\left(\frac{360(284 + N)}{365}\right)$$ where \(N\) is the day of the year. Then day length is $$D = \frac{24}{\pi}\,\arccos\!\left(-\tan\phi\,\tan\delta\right)$$ with \(\phi\) the latitude. When \(-\tan\phi\,\tan\delta\) falls outside \(\pm 1\) the Sun never sets (polar day, \(D = 24\)) or never rises (polar night, \(D = 0\)).
Worked example
At latitude 40° N on day 172 (around the June solstice), \(\delta \approx 23.45^{\circ}\). Then \(-\tan(40^{\circ})\cdot\tan(23.45^{\circ}) \approx -0.8391\cdot 0.4337 \approx -0.3640\), and \(\arccos(-0.3640) \approx 1.9438\ \text{rad}\). So $$D = \frac{24}{\pi}\cdot 1.9438 \approx 14.85\ \text{hours}$$ about 14 h 51 min of daylight.
FAQ
Why does my result differ from a sunrise table by a few minutes? Published tables include atmospheric refraction and the Sun's disc radius (~50' adjustment), which lengthen observed daylight slightly. This calculator gives the geometric center-of-Sun value.
Why is it capped at \(\pm 66.5^{\circ}\) latitude? Beyond the polar circles the Sun can stay up or down for 24 hours; the input range keeps results in the normal sunrise/sunset regime, though the math still handles the polar cases.
Which hemisphere uses negative latitude? Use negative latitude for the Southern Hemisphere, where seasons (and day lengths) are reversed relative to the North.