chinese-lunar-date API - v1.0.5
    Preparing search index...

    Function ganZhiToCycleIndex

    Heavenly Stems (天干) and Earthly Branches (地支) calculations. Used for year/month/day pillars in traditional Chinese timekeeping.

    • Get the 60-cycle index (1-60) from a GanZhi pair

      Uses the Chinese Remainder Theorem to find the unique position in the 60-term sexagenary cycle.

      Parameters

      Returns number

      Position in the cycle (1-60), where 1 = 甲子

      ganZhiToCycleIndex({ gan: 0, zhi: 0 })  // 1 (甲子)
      ganZhiToCycleIndex({ gan: 9, zhi: 11 }) // 60 (癸亥)