A calendar is a practical system for fixing the length and beginning of years and their subdivision into months and days. The word "calendar" comes from the Latin calendarium for "account-book." The main difficulty in drawing up calendars arises from the fact that the solar day (see day), the lunar month (see month), and the tropical year (see year) – the most immediate natural units of time – are not simple multiples of each other. In practice a solution is found in basing the system either on the phases of the Moon (lunar calendar) or on the changing of the seasons (solar calendar). The difficulty that the days eventually get out of step with the Moon or the seasons is got over by adding in (intercalating) one or more extra days or months at regular intervals in an extended cycle of months or years.


The earliest Egyptian calendar had a year of 12 months with 30 days in each, though later 5 extra days were added at the end of each year so that it approximated the tropical year of 365¼ days. In classical times the Greeks came to use a lunar calendar in which three extra months were intercalated every eight years (the octennial cycle), though, about 432 BC, the astronomer Meton discovered that 235 lunar months fitted exactly into 19 years (see Metonic cycle), this becoming the basis of the modern Jewish and ecclesiastical calendars. The Chinese calendar, too, is "lunisolar," with months that keep in step with the phases of the Moon and years that line up with the seasons. The Persian calendar on the other hand is solar, while the Islamic calendar is lunar.


The Roman calendar was reformed under Julius Caesar in 46 BC, fixing the year at 365 days but intercalating an additional day every fourth year (thus giving an average 365¼-day year). The 366-day year is known as a leap year. This Julian calendar continued in use until the 16th century, when it had become about 10 days out of step with the seasons, the tropical year in fact being a little less than 365¼ days. In 1582, therefore, Pope Gregory XIII order that 10 days be omitted from that year. Furthermore, century years would no longer be leap years unless divisible by 400, so that there would be no recurrence of any discrepancy. This Gregorian calendar was only slowly adopted, particularly in non-Catholic countries – the reform waiting until 1752 in England and its American colonies, by which time 11 days had to be dropped. But today it is in civil use throughout the world. Because it took from 1582 to 1918 for the Julian system to die out completely, astronomers have to specify to which calendar any given date in this interval refers.


Years are commonly numbered in Western societies from the birth of Christ – as computed by a 6th-century monk. Years since that epoch are labeled AD, years before BC. There is no year 0, 1 AD following directly from 1 BC. Astronomers, on the other hand, figure years BC as negative numbers one less than the date BC and include a year 0 (= 1 BC). The astronomers' year -10 is thus the same as 11 BC.