Leap year
A leap year is a calendar year that contains an additional day compared to a common year. The 366th day is added to keep the calendar year synchronised with the astronomical year or seasonal year. Since astronomical events and seasons do not repeat in a whole number of days, calendars having a constant number of days each year will unavoidably drift over time with respect to the event that the year is supposed to track, such as seasons. By inserting an additional day—a leap day—or month—a leap month—into some years, the drift between a civilisation's dating system and the physical properties of the Solar System can be corrected.
An astronomical year lasts slightly less than 365 days. The historic Julian calendar has three common years of 365 days followed by a leap year of 366 days, by extending February to 29 days rather than the common 28. The Gregorian calendar, the world's most widely used civil calendar, makes a further adjustment for the small error in the Julian algorithm; this extra leap day occurs in each year that is a multiple of 4, except for years evenly divisible by 100 but not by 400. Thus 1600, 2000 and 2400 are leap years, but not 1700, 1800, 1900, 2100, 2200, and 2300.
In the lunisolar Hebrew calendar, Adar Aleph, a 13th lunar month, is added seven times every 19 years to the twelve lunar months in its common years to keep its calendar year from drifting through the seasons. In the Solar Hijri and Bahá'í calendars, a leap day is added when needed to ensure that the following year begins on the March equinox.
The term leap year probably comes from the fact that a fixed date in the Gregorian calendar normally advances one day of the week from one year to the next, but the day of the week in the 12 months following the leap day will advance two days due to the extra day, thus leaping over one day in the week. For example, since 1March was a Friday in 2024, a Saturday in 2025, will be a Sunday in 2026, and a Monday in 2027, the date will then "leap" over Tuesday to fall on a Wednesday in 2028.
The length of a day is also occasionally corrected by inserting a leap second into Coordinated Universal Time because of variations in Earth's rotation period. Unlike leap days, leap seconds are not introduced on a regular schedule because variations in the length of the day are not entirely predictable.
Leap years can present a problem in computing, known as the leap year bug, when a year is not correctly identified as a leap year or when 29February is not handled correctly in logic that accepts or manipulates dates.
Julian calendar
On, by edict, Julius Caesar reformed the historic Roman calendar to make it a consistent solar calendar, thus removing the need for frequent intercalary months. His rule for leap years was a simple one: add a leap day every 4 years. This algorithm is close to reality: a Julian year lasts 365.25days, a mean tropical year about 365.2422 days, a difference of only. Consequently, even this Julian calendar drifts out of 'true' by about 3 days every 400 years. The Julian calendar continued in use unaltered for about 1600 years until the Catholic Church became concerned about the widening divergence between the March equinox and 21 March, as explained at Gregorian calendar, below.Prior to Caesar's creation of what would be the Julian calendar, February was already the shortest month of the year for Romans. In the Roman calendar, all months except February had an odd number of days29 or 31. This was because of a Roman superstition that even numbers were unlucky. When Caesar changed the calendar to follow the solar year closely, he made all months have 30 or 31 days, leaving February unchanged except in leap years.
Gregorian calendar
In the Gregorian calendar, the standard calendar in most of the world, almost every fourth year is a leap year. Each leap year, the month of February has 29 days instead of 28. Adding one extra day in the calendar every four years compensates for the fact that a period of 365 days is shorter than a tropical year by almost six hours. However, this correction is excessive and the Gregorian reform modified the Julian calendar's scheme of leap years as follows:Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100, but these centurial years are leap years if they are exactly divisible by 400. For example, the years 1700, 1800, and 1900 are not leap years, but the years 1600 and 2000 are.
Whereas the Julian calendar year incorrectly summarised Earth's tropical year as 365.25 days, the Gregorian calendar makes these exceptions to follow a calendar year of 365.2425 days. This more closely resembles a mean tropical year of 365.2422 days. Over a period of four centuries, the accumulated error of adding a leap day every four years amounts to about three extra days. The Gregorian calendar therefore omits three leap days every 400 years, which is the length of its leap cycle. This is done by omitting 29 February in the three century years that are not multiples of 400. By this rule, an entire leap cycle is 400 years, which totals 146,097 days, and the average number of days per year is 365 + − + = 365 + = 365.2425. This rule could be applied to years before the Gregorian reform to create a proleptic Gregorian calendar, though the result would not match any historical records.
The Gregorian calendar was designed to keep the March equinox on or close to 21 March, so that the date of Easter remains close to the March equinox. The "Accuracy" section of the "Gregorian calendar" article discusses how well the Gregorian calendar achieves this objective, and how well it approximates the tropical year.
Leap day in the Julian and Gregorian calendars
The intercalary day that usually occurs every four years is called leap day and is created by adding an extra day to February. This day is added to the calendar in leap years as a corrective measure because the Earth does not orbit the Sun in precisely 365 days. Since about the 15th century, this extra day has been 29 February, but when the Julian calendar was introduced, the leap day was handled differently in two respects. First, leap day fell February and not at the end: 24 February was doubled to create, strangely to modern eyes, two days both dated 24 February. Second, the leap day was simply not counted so that a leap year still had 365 days.Early Roman practice
The earliest Roman calendar was a lunisolar one, but it was abandoned about 450 BC by the decemviri, who implemented the Roman Republican calendar, used until 46 BC. The Republic's calendar consisted of 12 months, for a total of 355 days. In addition, a 27-day intercalary month, the Mercedonius, was sometimes inserted into February, at the first or second day after the Terminus a. d. VII Kal. Mar., to resynchronise calendar with the solar year. The remaining days of Februarius were discarded. This intercalary month, named Intercalaris or Mercedonius, contained 27 days. The religious festivals that were normally celebrated in the last five days of February were moved to the last five days of Intercalaris. The days of the months were counted down to the next named day, so 24 February was ante diem sextum Kalendas Martias often abbreviated a. d. VI Kal. Mart. The Romans counted days inclusively in their calendars, so this was the fifth day before 1 March when counted in the modern exclusive manner. Because only 22 or 23 days were effectively added, not a full lunation, the calends and ides of the Roman Republican calendar were no longer associated with the new moon and full moon.Julian reform
In Caesar's revised calendar, there was just one intercalary daynowadays called the leap dayto be inserted every fourth year, and this too was done after 23 February. To create the intercalary day, the existing ante diem sextum Kalendas Martias before the Kalends was doubled, producing ante diem bis sextum Kalendas Martias a second sixth day before the Kalends. This bis sextum was rendered in later languages as "bissextile": the "bissextile day" is the leap day, and a "bissextile year" is a year which includes a leap day. This [second instance of the sixth day before the Kalends of March was inserted in calendars between the "normal" fifth and sixth days. By legal fiction, the Romans treated both the first "sixth day" and the additional "sixth day" before the Kalends of March as one day. Thus a child born on either of those days in a leap year would have its first birthday on the following sixth day before the Kalends of March. In a leap year in the original Julian calendar, there were indeed two days both numbered 24 February. This practice continued for another fifteen to seventeen centuries, even after most countries had adopted the Gregorian calendar.For legal purposes, the two days of the bis sextum were considered to be a single day, with the second sixth being intercalated; but in common practice by the year 238, when Censorinus wrote, the intercalary day was followed by the last five days of February, a. ''d. VI, V'', IV, III, and pridie Kal. Mart., so that the intercalated day was the first of the doubled pair. Thus the intercalated day was effectively inserted between the 23rd and 24th days of February. All later writers, including Macrobius about 430, Bede in 725, and other medieval computists, continued to state that the bissextum occurred before the last five days of February.
In England, the Church and civil society continued the Roman practice whereby the leap day was simply not counted, so that a leap year was only reckoned as 365 days. Henry III's 1236 Statute De Anno et Die Bissextili instructed magistrates to treat the leap day and the day before as one day. The practical application of the rule is obscure. It was regarded as in force in the time of the famous lawyer Sir Edward Coke because he cites it in his Institutes of the Lawes of England. However, Coke merely quotes the Act with a short translation and does not give practical examples.