hour angle, then it is apparent that , which means . The above relation implies that on the same day, the lengths of daytime from sunrise to sunset at and sum to 24 hours if , and this also applies to regions where polar days and polar nights occur. This further suggests that the global average of length of daytime on any given day is 12 hours without considering the effect of atmospheric refraction. Generalized equation The equation above neglects the influence of atmospheric refraction (which lifts the solar disc — i.e. makes the solar disc appear higher in the sky — by approximately 0.6° when it is on the horizon) and the non-zero angle subtended by the solar disc — i.e. the apparent diameter of the sun — (about 0.5°). The times of the rising and the setting of the upper solar limb as given in astronomical almanacs correct for this by using the more general equation with the altitude angle (a) of the center of the solar disc set to about −0.83° (or −50 arcminutes). The above general equation can be also used for any other solar altitude. The NOAA provides additional approximate expressions for refraction corrections at these other altitudes. There are also alternative formulations, such as a non-piecewise expression by G.G. Bennett used in the U.S. Naval Observatory's "Vector Astronomy Software". Complete calculation on Earth The generalized equation relies on a number of other variables which need to be calculated before it can itself be calculated. These equations have the solar-earth constants substituted with angular constants expressed in degrees. Calculate current Julian day where: is the number of days since Jan 1st, 2000 12:00. is the Julian date; 2451545.0 is the equivalent Julian year of Julian days for Jan-01-2000, 12:00:00. 0.0008 is the fractional Julian Day for leap seconds and terrestrial time (TT). TT was set to 32.184 sec lagging TAI on 1 January 1958. By 1972, when the leap second was introduced, 10 sec were added. By 1 January 2017, 27 more seconds were added coming to a total of 69.184 sec. 0.0008=69.184 / 86400 without DUT1. The operation rounds up to the next integer day number n. Mean solar time where: is an approximation of mean solar time at expressed as a Julian day with the day fraction. is the longitude (west is negative, east is positive) of the observer on the Earth; Solar