Traditional Culture Encyclopedia - Almanac inquiry - What is heavenly stems and earthly branches's year, month, day and hour algorithm?

What is heavenly stems and earthly branches's year, month, day and hour algorithm?

Methods 1 and 60-ring extrapolation algorithm.

Methods: Calculate the branches and branches in a given year according to the order of 60 charts.

For example, it is known that 20 16 (after the Spring Festival) is the year of Shen Bing, and 2020 is the year of seeking ice.

Answer: Find Shen Bing in the table and push it back four years. We can know that 2020 (after the Spring Festival) is the year of boxer.

Method 2, formula calculation method

Methods: Find the annual stem and branch, the formula is (the number of years in the current year -3)÷60, and the rest is the annual stem and branch algebra, and then find the corresponding stem and branch in the 60-ring diagram. The reason why the number of years has decreased by 3 is that the fourth year of AD happens to be the year of Jiazi. Starting from the fourth year of AD, the three years before AD will be reduced, so this formula is applicable after the fourth year of AD.

Example: Find the main branch of 1979.

Answer: (1979-3)÷60 = 32...56. Find the corresponding branch of 56 in the 60-ring map, and we can know that 1979 is the last year.

Note: heavenly stems and earthly branches, referred to as Ganzhi for short, originated from the observation of astronomical phenomena in ancient China. Ten cadres refer to understanding, understanding, softness, feeling, harmony, slaughter, chapter, emphasis, lightness, mystery and brilliance. The twelve earthly branches refer to people who are trapped in hiding, people who are full of enthusiasm, people who are photogenic, people who are single-handed, people who are in charge of Xu, people who are in the wild, people who are hiding, people who are coordinating, people who are on the beach, people who are in a bad mood, castrated people and people with great depth.

The simplified heavenly stems and earthly branches: "A, B, C, D, E, Ji, G, Xin, Man and Ghost" is called the ten heavenly stems, and "Zi, Ugly, Yin, Mao, Chen, Si, Wu, Wei, Shen, You, Xu and Hai" are called the twelve earthly branches.

Ten heavenly stems and twelve earthly branches are matched in turn to form sixty basic units, and they cooperate with each other in a fixed order to form the chronology of the stems and branches. Heavenly stems and earthly branches's invention has far-reaching influence, and he still uses heavenly stems and earthly branches in calendar, mathematics, calculation, naming and so on.