HikeSpan · Daylight

Day length calculator

An approximate daylight length, not a sunrise time

How long the sun is up depends on latitude and the date. This page uses a classroom approximation: declination is about 23.44 degrees times the sine of a day angle, and the day length comes from the inverse cosine of the product of the latitude and declination tangents. It is not an almanac. It does not print a sunrise clock time. Finish-before-dark still wants the sunset you look up.

Inputs

Result

Fill in the fields and press Calculate.

Disclaimer: An approximate day length. Check an almanac for the sunset you will actually hike against.

How to use

  1. Enter latitude in degrees. North is positive. Forty is about the latitude of Philadelphia, not a default you must keep.
  2. Enter the day of the year. January 1 is 1. In a non-leap year, June 21 is 172.
  3. Press Calculate. The hero is hours of daylight.
  4. Latitudes beyond 66 degrees are rejected. Near the polar circles this approximation is the wrong tool.

How it's calculated

Declination ≈ 23.44° × sin(2π ÷ 365 × (day − 81)). Hour angle cosine = −tan(latitude) × tan(declination). Day length = (24 ÷ π) × acos(that cosine), when the cosine sits between −1 and 1.

The year length in the formula is 365 even if you type day 366. Mountains, refraction, and the equation of time are not in the formula. The result note repeats this.

Worked example

Latitude 40 on day 172, a non-leap June 21, is about 14.84 hours, with a declination near 23.44 degrees. The same latitude on day 81, around the March equinox, is 12.00 hours because the declination is about zero.

Assumptions

A smooth orbit approximation and a latitude between −66 and 66. The clock time of sunrise depends on longitude and the time zone, which this page does not ask for.

FAQ

Is this the sunset time?

No. It is a length in hours. Look up the sunset and type it into the turnaround or finish-before-dark page.

Why is the equinox 12 hours?

In this formula the declination is zero on day 81, so the day length is 12. A real equinox is close to 12 and not exact, because of refraction and how sunrise is defined.

What is day 172?

The 172nd day of a non-leap year, which is June 21. In a leap year the June dates shift by one after February.

Can I use this in Alaska?

Not reliably. The form stops at 66 degrees and tells you to use an almanac nearer the poles.

Related tools