The world's calendar is the smallest unit of day, but the algorithm on the year and month are different, can be divided into three categories:
Gregorian calendar-----------------------Gregorian
Lunar Calendar--with astronomical months as the main cycle of calendars, such as: Islamic calendar
Lunisolar-The main cycle of the calendar, for example: Chinese Lunar New Year and astronomical month
China's ancient people began to pay attention to the celestial phenomena, the day and night alternating as "days", the monthly profit and loss for the "month", the summer and the alternate "year", in the sum of the changes in the law of the lunar calendar and the Gregorian calendar year, known as the Chinese lunar calendar. This paper will introduce the calendar rules of Chinese lunar calendar, the calculation method of the celestial branch (Heavenly stems,earthly branches), the relationship between Shiber and the Chinese lunar calendar, and the precise time of the solar term and sun and moon combined Moon, to calculate the Chinese lunar calendar.
Before introducing the calendar of Chinese lunar calendar, we must first introduce the ancient Chinese annals method. In ancient China, in the annals of the Zodiac, strictly speaking, the zodiac and designates one are not part of the Chinese lunar calendar, but in Chinese history until today, the zodiac and the designates one have always been a close part of the Chinese lunar calendar, So here is a first introduction to the Zodiac and the designates one.
The ancient Chinese annals did not use numbers, but were combined with celestial stems and branches. There are 10 heavenly stems, respectively: A, B, C, Ding, E, himself, Geng, Xin, Ren, GUI, there are 12 branches, respectively: son, Ugly, Yin, Mao, Chen, Si, Wu, not, Shen, unitary, Xu, Hai. When the use of the heavenly stems and branches to take a word, the heavenly stems in front of the branch, after the combination into Ganzhi, such as Yi Yi, and so on, and so on, the reincarnation can be formed 60 combinations, with these celestial branches and branches of the annals, every 60 Years a reincarnation, known as a century In fact, the ancient Chinese Guile, Guiger and Guishring all adopt Ganzhi method, these Ganzhi together is our familiar birthday. Designates one also known as the "12 Zodiac", from 11 species of animals derived from nature: rats, cows, tigers, rabbits, snakes, horses, sheep, monkeys, chickens, dogs, pigs and legends of the Dragon, used in the annals, in order and 12 of the combination of Cheng, ugly ox, Yin Hu, Mao Rabbit, Chen Long, snake, afternoon horse, sheep, shen Monkey, unitary chicken, Xu Dog and Hai Pig. The Zodiac and the 12 Zodiac are often combined to describe the lunar year, such as the Gregorian calendar 2011 is the Lunar Sing, 2012 is the year of the Dragon and so on.
To calculate the celestial branches of a certain year, there are many empirical formulas, if you know the celestial branches of a certain year, you can also directly calculate the other years of the celestial and earthly branches. For example, if you know that 2000 is the year of the dragon, then 2012 years of Ganzhi can be calculated as follows: (2012-2000) The 10=2,2012 of the year is from the beginning of the Geng to push back 2 of the celestial, that is, the 2012 of the earthly branches can be calculated: (2012-2000)% 12 = 0, the 2012 branch of the branch is still Chen, so 2012 years of the zodiac is the Ren Chen, 12 zodiac year of the Dragon. For years prior to 2000, when the year difference is calculated, only the celestial and earthly branches can be extrapolated forward. For example, the Ganzhi of 1995 can be calculated as follows: (2000–1995)%10 = 5, (2000–1995)%12 = 5, Geng forward 5 that is B, Chen forward calculated 5 that is Hai, so 1995 years of Ganzhi is the B-Hai, 12 zodiac year of the pig. The implementation of this Ganzhi algorithm is as follows:
Calculateyearganzhi Void (int year, int *gan, int *zhi)
203 {
204 int sc = year-2000;
205 *gan = (7 + sc)% 10;
206 *zhi = (5 + sc)% 12;
207
if (*gan < 0)
209 *gan + + 10;
210 if (*zhi < 0)
211 *zhi + + 12;
212}
Ganzhi of the 2008:
9 TCHAR *nameoftiangan[counts_for_tiangan] = {_t ("a"), _t ("B"), _t ("C"), _t ("Ding"), _t ("E"), _t ("Self"), _t ("Geng"), _t ("symplectic"), _t (" ren "), _t (" GUI ")};
TCHAR *nameofdizhi [Counts_for_dizhi] = {_t ("Zi"), _t ("ugly"), _t ("Yin"), _t ("Mao"), _t ("Chen"), _t ("I"), _t ("Afternoon"), _t ("not"), _t ("Shen") , _t ("unitary"), _t ("Xu"), _t ("Hai")};
146 int Gan,zhi;
147
148 Calculateyearganzhi (2008, &gan, &zhi);
149
Text. Format (_t ("Lunar"%s%s "%s Years"),
151 year, M_curmonth, Nameoftiangan[gan-1], nameofdizhi[zhi-1], nameofshuxiang[zhi-1]);
The result is: Lunar New Year of the rat.