The desire for a quantitative determination of time led already very early to different systems of the calendar. The need for a correct calendar and eventually a reliable time scale was given by religious reasons and economic necessities in the prevailing societies.
Since the Babylonians and Egyptians the path of the sun and the moon were used as measure for a calendar and eventually for a time scale. Also Greeks, Jews, Romans, Mayas, just to name some nations, formed their specific calendar. Likewise, in Christianity models for a correct calendar have been developed, which cumulated in the Gregorian reform of the calendar in the year 1582. This calendar is valid until today and the worldwide standard of the calendar.
In order to adjust our calendar year permanently to the tropical year (365,2422 sun days) leap days have to be added. For practical reasons the single calendar years can have only an integer number of days, namely 365 (regular year) or 366 (leap year), respectively.
Whether a year is a regular year or a leap year can be determined by the following rules:
Rule 1: If the year can be divided by 100 without remainder, but not by 400, then this year is a regular year.
According to this rule e.g. the years 1700, 1800, 1900, 2100, 2200, 2300 are regular years. The years 1600, 2000 and 2400 are leap years.
Rule 2: For those years, that are not regular years according to rule 1, applies: If the year can be divided by 4 without remainder, it is a leap year, otherwise a regular year.
According to this rule e.g. the years 1996, 2000 and 2004 are leap years and 1997, 1998, 1999, 2001, 2002 and 2003 regular years.
By applying both rules we get 97 leap years in 400 years. The mean duration of calendar year is therefore 365 97/400 (= 365,2425) days and thus quite close to the duration of the tropical year.