Skip to content
OverCalculator
  1. Home
  2. Weather & Environment
  3. Daylight Hours Calculator
Weather & Environment

Daylight Hours Calculator

Calculate approximate daylight duration, local solar sunrise, sunset, and solar noon from latitude and date, including polar day and polar night cases.

Published

Enter values below

Fill in the highlighted fields to see your result.

Positive for North, negative for South.
Select a date to calculate daylight hours.

Results update as you type.

Daylight Hours Calculator

A daylight hours calculator explains one of the most noticeable weather-and-environment patterns: the same place gains and loses hours of sun through the year. From a latitude and date, this tool estimates total daylight plus local solar sunrise and sunset. The result helps with gardening, outdoor work, school sports, hiking start times, winter mood planning, and solar conversations where day length is a necessary but incomplete piece of the puzzle.

How it works

Earth’s axis is tilted, so the sun’s apparent path changes through the seasons. At mid-latitudes, summer days are long because the sun rises earlier, sets later, and travels a higher arc. Winter days are short because the arc is lower and the sun spends less time above the horizon. Near the equator, the change is modest. Near the Arctic and Antarctic Circles, the geometry can produce polar day or polar night.

The calculator converts the selected date to day of year. It estimates solar declination with a cosine approximation, combines that declination with latitude to calculate an hour-angle argument, and converts the hour angle to daylight duration. Sunrise and sunset are then placed symmetrically around local solar noon at 12:00. Because longitude and time zone are omitted, the displayed times are solar times, not civil clock times.

Use the result with the solar panel calculator if you are thinking about seasonal solar production, and with the solar panel angle calculator for tilt context. Gardeners can pair it with the plant light requirements calculator, because daylight duration alone does not tell you DLI or shade.

Formula

The calculation first finds day of year, N. Solar declination is approximated as:

δ=23.45cos(360365(N+10)π180)\delta=-23.45\cos\left(\frac{360}{365}(N+10)\frac{\pi}{180}\right)

The hour-angle argument is:

X=tan(ϕπ180)tan(δπ180)X=-\tan\left(\phi\frac{\pi}{180}\right)\tan\left(\delta\frac{\pi}{180}\right)

If X is greater than 1, the result is 0 hours for polar night. If X is less than negative 1, it returns 24 hours for polar day. Otherwise:

ω=cos1(X)180π\omega=\cos^{-1}(X)\frac{180}{\pi} L=2ω15L=\frac{2\omega}{15} R=12L2R=12-\frac{L}{2} S=12+L2S=12+\frac{L}{2}

Here, phi is latitude in degrees, delta is solar declination in degrees, omega is hour angle in degrees, L is daylight length in hours, R is approximate local solar sunrise, and S is approximate local solar sunset. The calculator formats L into hours and minutes.

Worked example

For latitude 51.5074 degrees north on June 21, 2026, the current JavaScript Date arithmetic in this project returns day-of-year 171 in a Pacific time runtime because the elapsed milliseconds cross a daylight-saving offset. Substituting N equals 171 gives a declination near 23.44 degrees. The argument X is about negative 0.545. The inverse cosine of that argument is about 123.04 degrees.

Day length is 2 times 123.04 divided by 15, which equals 16.4058 hours. The calculator separates that into 16 hours plus 0.4058 times 60 minutes, or 24 minutes after rounding. Local solar sunrise is 12 minus half of 16.4058, or 3.797 hours, formatted as 03:48. Local solar sunset is 20.203 hours, formatted as 20:12. Solar noon remains 12:00.

Those are not London clock times. They omit longitude, British Summer Time, the equation of time, and the standard sunrise definition that includes atmospheric refraction and the sun’s disk.

Interpreting daylight estimates

Daylight duration is a geometric baseline. It is useful for comparing seasons and latitudes: a June day in London is much longer than a June day near the equator, while December reverses the northern pattern. In the southern hemisphere, positive and negative latitude signs flip the seasonality. A negative latitude on the same June date will generally have shorter days than its northern counterpart.

For solar panels, more daylight can allow more generation, but clouds and low sun angle can dominate. Winter days may have fewer hours and lower sun elevation, reducing irradiance on a flat or poorly oriented surface. For plants, day length affects photoperiod-sensitive flowering, but shade and intensity decide whether leaves receive enough energy. That is why daylight, DLI, and frost dates answer different planning questions.

Edge cases, limitations, and common mistakes

The calculator handles polar conditions in two ways. It checks for latitudes above 66.5 degrees and solstice windows, then also checks the hour-angle argument for continuous daylight or darkness. The solstice check treats both high northern and high southern latitudes the same for the named summer and winter solstice windows, so it can oversimplify southern-hemisphere polar seasons. The day-of-year helper also uses elapsed milliseconds and floor, so daylight-saving transitions can shift N by one in some runtimes. The results can therefore oversimplify southern-hemisphere polar seasons and shift the day count around daylight-saving transitions.

Do not use the displayed sunrise or sunset for navigation, aviation, legal deadlines, prayer times, photography contracts, or safety-critical fieldwork. Official almanacs and NOAA solar calculators include more details. Local terrain can also matter: a mountain ridge can delay observed sunrise, and a sea horizon can reveal the sun earlier than an urban canyon.

Sources

Frequently asked questions

What does the daylight-hours estimate include?
It estimates astronomical day length from latitude and date. The result includes total daylight, approximate local solar sunrise, approximate local solar sunset, and solar noon. It does not use longitude, time zone, elevation, local horizon, atmospheric refraction, or daylight saving time.
Why does the calculator only need latitude and date?
Day length is mainly controlled by latitude and Earth's seasonal tilt on a given date. Longitude affects clock time, not the length of daylight. Because this tool reports local solar time, it can estimate duration without asking for a time zone or city.
Can it calculate polar day and polar night?
Yes. If the sun-angle geometry indicates continuous daylight, it returns 24 hours and labels polar day. If the geometry indicates no sunrise, it returns zero hours and labels polar night. The calculation also includes special solstice checks above 66.5 degrees latitude.
Are sunrise and sunset exact clock times?
No. They are approximate local solar times centered on solar noon at 12:00. Real clock times depend on longitude within the time zone, equation of time, daylight saving time, elevation, terrain, buildings, and the atmospheric definition of sunrise and sunset.
Is daylight duration the same as solar-panel energy?
No. Daylight duration tells you how long the sun is geometrically above the horizon. Solar production also depends on clouds, haze, panel tilt, panel orientation, shading, temperature, and solar intensity. Pair day length with solar-resource data for energy estimates.
How should gardeners use daylight hours?
Use daylight hours to understand seasonal timing and photoperiod pressure, especially for seedlings, flowering, and outdoor work. It does not measure plant-usable light intensity, shade, or DLI. Combine it with local frost dates and actual light measurements for planting decisions.

Related calculators

Daylight Hours Calculator updated at