The calendar we use was decreed, not invented: Julius Caesar imposed the 365-day Julian calendar in 45 BCE on the advice of the Alexandrian astronomer Sosigenes, and Pope Gregory XIII corrected it in 1582 with the Gregorian reform, dropping ten days and refining the leap year. Its ancestor was Egypt's 365-day civil calendar of about 3000 BCE.
Before calendars, farmers watched the sky. Egypt's priests noticed the Nile flood returned with the star Sirius and built a 365-day year of twelve 30-day months plus five feast days — the first civil calendar, and the model Caesar copied. The Maya, the Chinese and the Romans all ran their own systems, but the Gregorian calendar won the planet: today it is the civil standard in nearly every country on earth.