As with many things, like candles, umbrellas and aqueducts, we have the ancient Romans to thank for our modern calendar. The names of the months bear witness: January, named for the god Janus and March for the god Mars. In the early days of the Roman calendar, it followed a lunar cycle and there were ten months. This is why the months September (“seventh”) through December (“tenth”) are now strangely misnamed. When the solar calendar added months during the reign of Caesar Augustus, so too were months honoring the Caesar dynasty – Augustus and Julius. Naturally, those months then had to have the most days, 31, as well as October (Caesar Octavius). So while the calendar approximated the sun’s travel across the heavens, these imperially designated long months threw a spanner in the works.
Similarly, the concept of Leap Year was the result of a political, or rather religious, decree. Pope Gregory wanted to make sure that Easter fell as close to the spring equinox as possible every year so he determined that every fourth February should get an extra day to keep the calendar synchronized to the seasons. This “Gregorian” calendar compensates for the fact that our 365 year is six hours shorter than a solar year and thus “resets” it every four years.