There is a passage in "Li Jingzhi", which can well summarize the origin of the lunar calendar: "Emperor Yan started the eighth section of agriculture, and XuanYuanJi made a detailed book contract, so that xi occupied Japan, and the long-term foreigners occupied the moon, and the earth astrologed, while Ling Lun created laws and made great efforts to make Jia Zi and officials the first number. Rongcheng integrates six arts, measures the weather, builds five elements, observes convergence, starts news, and describes it, which is called "calendar adjustment". Therefore, the origin of the calendar is still there. "
The so-called "calendar" created in the period of Xuanyuan Huangdi belongs to the yin and yang calendar. According to the unearthed Oracle bone inscriptions and the records of ancient books in China, the current rules of combining yin and yang calendars will not be later than the Yin and Shang Dynasties.
The calendar of the Yin and Shang Dynasties was quite mature, so although there were no unearthed objects in the Xia Dynasty, the official records of China's ancient books were reliable and worthy of reference. From the ancient six calendars to the present, China has revised the calendar many times to improve the accuracy of calculation. These calendars had a great influence on the culture and civilization of China, such as the Xia calendar, the Lunar calendar, the Zhou calendar, the Western Han calendar, the Emperor Yangdi calendar and the Dayan calendar in the Tang Dynasty.
In the calendar of China before the Han Dynasty, 365.25 was regarded as a year (tropic year), the moon was regarded as a calendar month, and leap months were used to coordinate the relationship between them. There are already time units of day, month, ten-day and hour, and the technology of yin-yang calendar is available; The motion laws of five planets, the sun, the moon and the earth in Jin Mu were observed. The implementation of the calendar has become a major event, and one of the main contents is to "set the age at four o'clock in the leap month" and "be profitable". From this, we can determine the end and beginning of the era. During the Spring and Autumn Period and the Warring States Period, due to the decline of the royal family in the Zhou Dynasty, the governors went their own way, so a multi-track calendar appeared, that is, the governors and local tribes also had their own local calendars;
At the beginning of Han Dynasty, there was a major turning point in China calendar, and the national unified calendar became a relatively independent science and technology. Emperor Wu of the Han Dynasty instructed, Luo and others to discuss and create the "Han Li", which took him seven years to complete. In May of that year, the year number was changed to Taichu (that is, the first year of Taichu), and this set of "Han Li" was promulgated and implemented. Later generations called this calendar "taichu calendar". The remarkable feature of this calendar is that it establishes the rules of using Xia Zheng Yin Jian and neutral gas to set leap. Since then, the calendar versions issued by China in the past dynasties have been revised based on this algorithm, and the rules have been changed very little, but they have been changed from leveling to leveling and fixing the moon, so as to better conform to the operation of celestial bodies and improve the accuracy.