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

    Function formatGanZhi

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

    • Format a GanZhi pair as a string

      Parameters

      Returns string

      The combined stem-branch string

      formatGanZhi({ gan: 0, zhi: 0 })  // "甲子"
      formatGanZhi({ gan: 3, zhi: 9 }) // "丁酉"