2024 is a leap year, which means that this February will have an extra day tacked onto the end. But why February? Why not put Leap Day at the beginning of the year, say Jan. 0, or at the end, Dec. 32?
It may seem an odd and arbitrary choice but the origins of Feb. 29 are actually steeped in the long history of timekeeping, astronomy, and the evolving attempts to align the two through mathematics.
Read More: Who Decided January 1st Is the New Year?
Intercalation, or the insertion of days in a calendar, has been tried and tested across civilizations, to try to ensure that lunar and solar schedules remain compatible and consistent with the tracking of seasons. The practice varies across cultures: the ancient Egyptian calendar year was composed of 12 30-day months, with five epagomena (days) appended at every year’s end. In lunisolar timekeeping like in the Chinese calendar, an extra month is added every three years, allowing adherents in those years to celebrate two spring months to welcome in the new year or “double spring.” Similarly, in the Vikrami and Hebrew calendars, a month is added once every three years or so, following the moon’s 19-year cycle of phases. Islam’s lunar calendar has a 30-year cycle in which 11 of those years have an extra day added to the month.
But the modern Leap Day as we know it traces its roots back to ancient Rome. Romulus, the first king of Rome, established the Roman Republican calendar around 738 B.C., decreeing that a year began in Martius (now called March), was only 10 months long, and didn’t account for winter because people didn’t work then. But frustrated by irregularities and cognizant of the Roman calendar’s differences with other calendars, by the 7th century B.C., Numa Pompilius, the second Roman king, decided that it was time to start formally counting winter months. Thus Ianuarius (January) and Februarius (February) were added—at the end of the calendar year.
More From TIME
Still, even after adding these two months, the Roman calendar every so often went out of whack with the seasons. So about every two years, Roman consuls would discretionarily add a 27- or 28-day 13th month—Mercedonius, or sometimes called Intercalaris—to shift their measure of time back in sync with the sun. Typically, the extra month would be inserted after Feb. 23, cutting short February by five days to immediately follow the celebration of Terminalia, an annual festival on Feb. 23 that honors the ancient Roman god of boundaries Terminus.
Then came Julius Caesar, who ordered a new solar calendar, created with the help of Greek astronomer Sosigenes, who was an adviser to Egypt’s Cleopatra, whom Caesar was known to consort with. The new Julian calendar—which took effect in 45 B.C. after a corrective 445-day ultimus annus confusionis (“last year of confusion”)—was based on the math that a year should consist of exactly 365 days and 6 hours, and that every four 365-day years those extra six hours would total to one extra day.
Caesar’s calendar added this intercalary day after Feb. 23 by extending Feb. 24 to 48 hours. Because this double day fell on the sixth day before the start of March, it came to be known as the bissextus, and some cultures to this day refer to leap years as bissextile years.
The Julian calendar, which also made the official start of the civil year Jan. 1, would be used throughout Europe for centuries as the Roman Empire expanded, but its rule of inserting a leap day every four years still overshot the solar year by 11 minutes annually. That discrepancy would accumulate to cause a 10-day difference with the actual solar cycle by the 16th century, leading then Pope Gregory XIII to introduce a new calendar in the 1570s: the Gregorian calendar that we use today, which adjusted the every-four-years rule for leap years to exclude centurials (i.e., 1700, 1800, 1900...) except those divisible by 400 (i.e., 1600, 2000, 2400). The Catholic Church maintained, however, the repetition of Feb. 24 rather than adding a new day elsewhere for various reasons related to the celebration of Easter and saints’ days.
But not everyone was quick to adopt the Gregorian calendar. Sweden even switched back and forth between the Julian and Gregorian calendars, with the resultant mix-ups eventually requiring an extra two days to resolve in 1712, leading to a rare observation of Feb. 30 for Swedes that year. Meanwhile, it took even longer for the U.K. and its American colonies to fully adopt the more accurate Gregorian calendar, given their strained ties with the papacy, but they also eventually relented. In 1752, the Calendar (New Style) Act was implemented, moving the new year for the British from March 25 (Anglicans’ Feast of the Annunciation) to the more familiar Jan. 1 and formalizing the quadrennial intercalary day to be referred to going forward as Feb. 29, which has since become the international standard.
It would seem safe to assume that humanity had perfected the art of tracking time by now, but one more adjustment was made beginning in 1972: leap seconds, which help to make up for an ever-so-slight remaining difference between Coordinated Universal Time (UTC), which is based on the Gregorian calendar, and atomic time, which more closely approximates solar time and is slightly faster. But timekeeping is not an exact science—and sometimes it causes so many headaches that experts decide to stop pursuing such precision, such as in 2022, when the world’s foremost metrology body decided to abandon leap seconds altogether by 2035.