It’s hard to think of anything as complex, and yet as humdrum, as the calendar. These days, clocks and calendars are so ubiquitous—the screen you’re looking at right now can instantly tell you the time and date—that we’re blissfully unaware of the centuries-old intellectual struggle involved in their creation. What better day than February 29—a day that comes only once every four years—to reflect on the story behind our seemingly esoteric method of counting the days of the year.

BLAME IT ON THE SUN, MOON, AND SEASONS

The complexity of our timekeeping systems isn’t really humanity’s fault. If you’re looking for a scapegoat, I’d blame the solar system. The urge to keep track of time is probably as old as our species, and the most obvious signs of time’s passage are the cycles we observe in nature, especially the regularities we see in the night sky.

Most obvious are the day (measured by the rising or setting of the Sun); the month (measured by tracking the phases of the Moon); and the year (the annual cycle of the seasons). But timekeeping soon gets complicated, because none of these cycles fit neatly into one another: The lunar month is about 29.5 days long (actually 29.5306); the average year as defined by the seasons—also known as the “solar” or “tropical” year—is about 365.25 days long (actually a smidgeon less, at 365.2422 days). And the month refuses to fit neatly into the year, too, for that matter (there are more than 12, but less than 13, lunar cycles in a year). Over the centuries, different civilizations tried every possible trick to try to reconcile these incongruent cycles.

It would have been nice if there were 360 days in a year: The math would be wonderfully simple, since 360 can be divided by 2, 3, 4, 5, 6, 8, 9, 10, and—well, I won’t list them all, but 360 has 22 divisors in all (not counting 1 and 360). But no such luck; the year actually has a bit more than 365 days.

FROM THE EGYPTIANS' FIVE-DAY PARTY TO POPE GREGORY VIII'S MISSING 11 DAYS

The ancient Egyptians had a fairly elegant solution: Use a 360-day calendar, with 12 months of 30 days each, and then enjoy five days of feasts and celebrations at the end of each year. But it still wasn’t perfect: The resulting year of 365 days is still about a quarter-day short of the true solar year.

The Egyptians recognized this discrepancy early on, and realized that adding an extra day every four years would bring the average length of the year to within just a few minutes of the true solar (tropical) year. It wasn’t until 238 BCE, however, that the Egyptian king Ptolemy III pushed for the adoption of a leap-year system. The Romans—whose empire would eventually encompass Egypt—tried a variety of calendar systems, eventually adopting the now-familiar leap year system, in which every fourth year has 366 days, instead of the usual 365. They’re also responsible for the peculiar lengths of the months. Initially, the idea was to have alternating 30-day and 31-day months, but successive rulers fiddled with those lengths. (For example: July, named for Julius Caesar, had 31 days; naturally, his successor, Augustus, demanded that August must have 31 also—the extra day being taken away from lowly February.)

The Roman calendar wasn’t perfect. Its average year of 365.25 days was just slightly shorter—by about 11 minutes—than the true solar year. By the time of Pope Gregory XIII, in the late 1500s, that discrepancy added up to 10 full days. Springtime holidays like Easter were drifting awkwardly into summer. Gregory convened a council of mathematicians and astronomers, who eventually found a way to make the average year just slightly longer: In the old system, “century years” like 1500, 1600, and 1700 would be leap years because they’re divisible by 4; under the new plan, only those century years divisible by 400 (such as 1600 and 2000) would be leap years.

The proposed reform was adopted in 1582—at which point 10 days were dropped from the calendar to let it “synch up” with the seasons (and so October 4, 1582, was followed by October 15). Some people were distressed at what seemed to be “lost” time. Merchants puzzled over the calculation of profits and losses; bankers were befuddled by interest rates.

CATHOLICS AND PROTESTANTS ALSO FOUGHT OVER THE CALENDAR

While Catholic countries quickly adopted the Gregorian calendar, Protestant countries held off. In Britain, the new calendar wasn’t adopted until 1752—at which point 11 days had to be dropped from the year, in order to “catch up.” Protests broke out in London and Bristol, with workers shouting, “Give us back our 11 days!” Interestingly, such tensions have not entirely disappeared; as The Telegraph points out, some people resent having to work an extra day for no pay in leap years.

Leap years, which have been a part of our timekeeping system for more than 2000 years, barely warrant notice these days— although today’s Google Doodle serves as a cute reminder. Of course, if you’re one of the 4 million or so living leap day babies, known as “leaplings” or “leapers,” you’re likely hyper-aware of leap years. (Calculating the number of people with a February 29 birthday is tricky, by the way: The fraction of babies born on February 29 isn’t 1 in 365, but rather, about one in 1460, since February 29 occurs only once every four years—or, to be precise, 97 times every 400 years.) Famous leap-babies include motivational speaker Tony Robbins, rapper Ja Rule, and the 16th-century pope Paul III. Intriguingly, two major events—the Summer Olympics and U.S. national elections—are always held in leap years.

Dan Falk (@danfalk) is a science journalist based in Toronto. He explored time and timekeeping in his 2008 book, In Search of Time.