Heavenly Stems (天干) and Earthly Branches (地支) calculations. Used for year/month/day pillars in traditional Chinese timekeeping.
Parse a GanZhi string back to pair indices
A 2-character GanZhi string (e.g., "甲子")
The corresponding GanZhi pair, or null if invalid
null
parseGanZhi('甲子') // { gan: 0, zhi: 0 }parseGanZhi('丁酉') // { gan: 3, zhi: 9 }parseGanZhi('XX') // null Copy
parseGanZhi('甲子') // { gan: 0, zhi: 0 }parseGanZhi('丁酉') // { gan: 3, zhi: 9 }parseGanZhi('XX') // null
Heavenly Stems (天干) and Earthly Branches (地支) calculations. Used for year/month/day pillars in traditional Chinese timekeeping.