Guides How DaySight calculates

How DaySight calculates these times

Updated

Every time on DaySight is worked out from the sun's position for the place you're looking at. Nothing is copied from a table. This page says how, and where the limits are.

The sun's position

DaySight uses SunCalc, an open-source library for the sun's position and the times of sunrise, sunset and twilight. Its formulas come from the Astronomy Answers article on the position of the sun. Given a date and a place's latitude and longitude, it gives the sun's height above or below the horizon at any moment.

The four times

Each one is the moment the sun reaches a set height:

  • First light is when the sun is 6° below the horizon, before sunrise. The sky is bright enough to see by without lamps. Astronomers call it civil dawn.
  • Sunrise is when the top edge of the sun appears on the horizon. The calculation allows for the size of the sun and for the atmosphere bending its light.
  • Sunset is when the top edge of the sun disappears.
  • Last light is when the sun is 6° below the horizon again, after sunset. Astronomers call it civil dusk.

For New York on December 21, 2026 that gives first light at 6:46 AM, sunrise at 7:17 AM, sunset at 4:32 PM and last light at 5:03 PM.

First light 6:46 AMSunrise 7:17 AMSunset 4:32 PMLast light 5:03 PM12 AM6 AMNoon6 PM12 AM
New York, December 21. The curve is the sun's height through the day. First light and last light are where it crosses 6° below the horizon; sunrise and sunset are where it crosses the horizon.

Day length and light

"Sun up" and "daylight" mean sunrise to sunset. "Light" means first light to last light, which is all the time the sky is bright enough to see by. Changes in day length, such as the daylight gained since the solstice, compare sunrise-to-sunset lengths on different dates.

New York's shortest day has 1 h 2 min more light than sun

December 21, 2026. Violet is first light and last light, when the sun is below the horizon but the sky is bright; amber is the sun up.

Light: 10 h 17 minFirst light 6:46 AMLast light 5:03 PMFirst light to sunrise: 31 minSunset to last light: 31 minSunrise to sunset: 9 h 15 minSunrise 7:17 AMSunset 4:32 PMSun up: 9 h 15 min4 AM8 AMNoon4 PM8 PM

Source: DaySight, calculated from the sun's position for each city.

Time zones and clock changes

Times are shown in the place's own time zone, found from its latitude and longitude with tz-lookup, and follow its clock changes. City tables on the guides use each city's standard time in winter. Times are rounded to the minute.

Solstices and equinoxes

The exact moments of the solstices and equinoxes are not calculated by DaySight. They come from the US Naval Observatory's Earth's Seasons table.

Your place

If you've chosen a place in the DaySight app, the guides use it. Otherwise they use the town your connection appears to come from, which the hosting service provides with each request. Nothing about your location is stored. You can change the place on any guide.

Limits

The calculation assumes a flat, open horizon. Hills, buildings and trees can hide the sun after it has risen, and being high above the ground lets you see it earlier. Weather does not change these times, but cloud changes how much light reaches you.

A hill or a building can hide the sun after sunrise

DaySight assumes a flat, open horizon. Anything higher in the direction of sunrise delays the sun you see; at sunset it hides it early.

YouCalculated sunrisesun on a flat horizonYou see the sunonce it clears the hill

Diagram, not to scale.