The Roman republican used calendar derived from the
Greek lunar calendar, which was from the Babylonian.
The Roman calendar consisted of 10 months: Martius, Aprilis, Maius, Junius, Quintilis, Sextilis, September, October, November, and December and of a year of 304 days.
Later, January was added at the beginning and February at the end. In 452 BC, February was moved between January and March.
By the 1st century BC, the Roman calendar calculating on cycles and phases of the moon, totaled only 355 days in a year, about 10 1/4 days shorter than the solar year.
In 46 BC, Julius Caesar initiated a thorough reform, making the new calendar solar, not lunar, and he took the length of the solar year as 365 1/4 days. The year was divided into 12 months, all of which had either 30 or 31 days except February, which contained 28 days in common (365-day) years and 29 in every fourth year (a leap year, of 366 days). This calendar had overestimated the length of the year by 11 minutes 14 seconds (the solar year comprises 365 days, 5 hours, 48 minutes, 46 seconds).
By the mid-1500s, the cumulative effect of this error had shifted the dates of the seasons by about 10 days from Julius Caesar's time. In 1582, Pope Gregory XIII restored the calendar to the seasonal dates of AD 325 by advancing the calendar 10 days after Oct. 4, 1582, the day following being reckoned as 15 October, 1582. (5 -14 October 1582 missing)
The Gregorian calendar differs from the Julian only in that no century year is a leap year unless it is exactly divisible by 400 (e.g., 1600, 2000). A further refinement, the designation of years evenly divisible by 4,000 as common (not leap) years, will keep the Gregorian calendar accurate to within one day in 20,000 years.