Heavenly stems and earthly branches is matched with each other, which is used to look at the annual rings in the calendar. It's the same at any time What do you mean from ancient times to the present?

The trunk is heavenly stems and earthly branches's floor. Ten symbols such as A, B, C, D, E, Ji, G, Xin, Ren and Gui are called heavenly stems, and twelve symbols such as Zi, Ugly, Yin, Mao, Chen, Si, Wu, Wei, Shen, You, Xu and Hai are called earthly branches. The sequence of matching the main branch and the secondary branch is exactly 60 weeks, which is recorded repeatedly, commonly known as "counting the years (months, days and hours) of the main branch and the secondary branch".

For example, the chronological method, the first year is Jiazi, the second year is ugly, and so on. Twelve months, dates, hours, etc. Can be calculated in a similar way.

The formula you listed describes this timing method.