A calendar is a system of organizing days in a year. 

Many people believe that year is 365 days, but it is not accurate. You probably noticed, there is a leap year with February 29, which has 366 days, every four year. Most accurate measurement of year giving us length of the year as 365.2422 days. So, any accurate calendar should be organized such a way to compensate an error of having 365 days year instead of 365.2422 days. That is why our modern Gregorian calendar has a leap year (February, 29) every four year. Extra .2422 day of year giving us almost one extra day (.2422 x 4 = .9688 day) every four years. Because .9688 is not exactly a one day, every year witch has two zeroes at the end it is not a leap year, except years witch could be divided to 400. Let say 1996 was leap year, 2004 was a leap year. But, 2000 on first view not suppose to be leap year, it has two zeroes at the end, but because it could be divided to 400 it was a leap year too.

Most famous ancient calendar used today is Jewish or Hebrew calendar. In old time people could not calculate number of days in the year but rather calculate number of days in lunar cycles (lunar phases). Jewish calendar is a very old, and was very accurate for time it was designed, is based on moon's cycle 29.53058853 days. It takes approximately 29 and half days for moon to orbit earth. That is why Jewish months are only 29 and 30 days in sequence to give you average of 29 1/2 days per month.

Every time moon is orbiting the earth it changes on a night sky by phase, recognized by people like four phases, four quarters. Each quarter, half moon is getting visible or invisible. Each quarter is approximately 7.4 days (about one week).

Lunar appearance on Earth

That is how we got understanding of the month. Our definition of month coming from lunar cycle orbiting the earth and is around 30 days. Remember exact length of the month is moon's cycle 29.53058853 days. When people realized that year is approximately 365 days and 12 lunar months, our modern calendar was born. So, accurate astronomical observation give us a length of year 365.2422 days, that is how many times earth making a complete revolutions on it own axis per year, while making whole circle, orbiting the sun. Numbers of months in calendar, reflecting fact of how many times moon is orbiting the earth per year. Accurate calculation giving us a number 12.368267. That is, how many times moon is orbiting the earth per year and how many actual months we have per year. These numbers are base for building the modern calendar, with years, months and days.

Our most resent and accurate modern calendar is Gregorian calendar. It is named for Pope Gregory XIII, who introduced it in 1582. The reform was adopted initially by the Catholic countries of Europe. Protestants and Eastern Orthodox countries continued to use the traditional Julian calendar and adopted the Gregorian reform after a time, for the sake of convenience in international trade. The last European country to adopt the Gregorian calendar was Greece, in 1923.

Country Start numbered year
on 1 January
Adoption of
Gregorian calendar
Denmark ~ 1700
Dutch Republic 1583 1582
France 1564 1582
Great Britain 1752 1752
Holy Roman Empire 1544 1583
Russia 1700 1918
Scotland 1600 1752
Southern Netherlands 1576 1582
Spain, Poland, Portugal 1556 1582
Sweden 1559 1753
Tuscany 1721 1750
Venice 1522 1582

To be an accurate calendar has four years cycle of three years with 365 days and one year, the leap year, with 366 days. One extra day is added to February as a February 29. Average length of year coming to 365.25 days. Remember, real length of the year is: 365.2422 days. So, calendar has to do even better than that. To compensate even that small error, Gregorian calendar not giving years with two zeroes at the end, a chance to be a leap years. And even more accurate condition, even year who has two zeroes at the end but could be divided on 400, also should be a leap year. That is what happened to year 2000. Should not be a leap year, because of two zeroes at the end, but could be divided to 400 and it was a leap year too. All of this makes a Gregorian calendar to be extremely accurate.

Pope Gregory XIII  First page of the papal bull Inter gravissimas Christopher Clavius (15381612), one of the main authors of the reform.