The time of sunset is defined in astronomy as the moment when the trailing edge of the Sun's disk disappears below the horizon. Near to the horizon, atmospheric refraction causes the ray path of light from the Sun to be distorted to such an extent that geometrically the Sun's disk is already about one diameter below the horizon when a sunset is observed.
Sunset is distinct from twilight, which has three phases, the first being civil twilight, which begins once the Sun has disappeared below the horizon, and continues until it descends to 6 degrees below the horizon; the second phase is nautical twilight, between 6 and 12 degrees below the horizon; and the third is astronomical twilight, which is the period when the Sun is between 12 and 18 degrees below the horizon. Dusk is at the very end of astronomical twilight, and is the darkest moment of twilight just before night. Night occurs when the Sun reaches 18 degrees below the horizon and no longer illuminates the sky.
Locations north of the Arctic Circle and south of the Antarctic Circle experience no sunset or sunrise on at least one day of the year, when the polar day or the polar night persists continuously for 24 hours.
Sunset creates unique atmospheric conditions such as the often intense orange and red colors of the Sun and the surrounding sky.
The time of sunset varies throughout the year, and is determined by the viewer's position on Earth, specified by longitude and latitude, and elevation. Small daily changes and noticeable semi-annual changes in the timing of sunsets are driven by the axial tilt of Earth, daily rotation of the Earth, the planet's movement in its annual elliptical orbit around the Sun, and the Earth and Moon's paired revolutions around each other. During winter and spring, the days get longer and sunsets occur later every day until the day of the latest sunset, which occurs after the summer solstice. In the Northern Hemisphere, the latest sunset occurs late in June or in early July, but not on the summer solstice of June 21. This date depends on the viewer's latitude (connected with the Earth's slower movement around the aphelion around July 4). Likewise, the earliest sunset does not occur on the winter solstice, but rather about two weeks earlier, again depending on the viewer's latitude. In the Northern Hemisphere, it occurs in early December or late November (influenced by the Earth's faster movement near its perihelion, which occurs around January 3).
Likewise, the same phenomenon exists in the Southern Hemisphere, but with the respective dates reversed, with the earliest sunsets occurring some time before June 21 in winter, and latest sunsets occurring some time after December 21 in summer, again depending on one's southern latitude. For a few weeks surrounding both solstices, both sunrise and sunset get slightly later each day. Even on the equator, sunrise and sunset shift several minutes back and forth through the year, along with solar noon. These effects are plotted by an analemma.
Neglecting atmospheric refraction and the Sun's non-zero size, whenever and wherever sunset occurs, it is always in the northwest quadrant from the March equinox to the September equinox, and in the southwest quadrant from the September equinox to the March equinox. Sunsets occur almost exactly due west on the equinoxes for all viewers on Earth. Exact calculations of the azimuths of sunset on other dates are complex, but they can be estimated with reasonable accuracy by using the analemma.
As sunrise and sunset are calculated from the leading and trailing edges of the Sun, respectively, and not the center, the duration of a daytime is slightly longer than nighttime (by about 10 minutes, as seen from temperate latitudes). Further, because the light from the Sun is refracted as it passes through the Earth's atmosphere, the Sun is still visible after it is geometrically below the horizon. Refraction also affects the apparent shape of the Sun when it is very close to the horizon. It makes things appear higher in the sky than they really are. Light from the bottom edge of the Sun's disk is refracted more than light from the top, since refraction increases as the angle of elevation decreases. This raises the apparent position of the bottom edge more than the top, reducing the apparent height of the solar disk. Its width is unaltered, so the disk appears wider than it is high. (In reality, the Sun is almost exactly spherical.) The Sun also appears larger on the horizon, an optical illusion, similar to the moon illusion.
Locations north of the Arctic Circle and south of the Antarctic Circle experience no sunset or sunrise at least one day of the year, when the polar day or the polar night persist continuously for 24 hours.