The Heavenly Stems (Tiangan) and Earthly Branches (Dizhi), collectively called Ganzhi, are said to have been created by Danao over 4,600 years ago during the era of the Yellow Emperor. The original meaning refers to tree trunks and branches.
The Stems were initially used only for counting days. Since a day was measured from sunrise to sunrise, they became known as "Heavenly Stems." There are ten Stems in sequence: Jia, Yi, Bing, Ding, Wu, Ji, Geng, Xin, Ren, and Gui—forming one ten-day cycle (xun).
The Branches were originally used for counting months, measured by the waxing and waning of the moon. There are twelve Branches, also called the Twelve Chen: Zi, Chou, Yin, Mao, Chen, Si, Wu, Wei, Shen, You, Xu, and Hai.
In the history of Chinese calendrics, the Ganzhi system for counting days appeared earliest. Oracle bone inscriptions show it was already in widespread use by mid-Shang Dynasty. According to existing records, continuous Ganzhi day-counting has been maintained from at least the second month of Duke Yin of Lu's third year (722 BCE) through the third year of Xuantong (1911 CE), spanning over 2,600 years without interruption—the longest continuous dating record known to humanity.
