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

    Function zodiacFromGregorianYear

    Chinese zodiac animal signs. Locale-aware: returns different names for zh-CN ("龙"), zh-TW ("龍"), ja-JP ("辰"), ko-KR ("진"), vi-VN ("Thìn").

    • Get zodiac animal from a Gregorian year

      Note: This uses the Gregorian year directly, which may differ from the lunar year for dates before Chinese New Year. For precise results, use zodiac with a LunarDateValue.

      Parameters

      • gregorianYear: number

        Gregorian year (e.g., 2024)

      • locale: string = 'zh-CN'

        Locale code (default: 'zh-CN')

      Returns string

      Localized zodiac animal name

      zodiacFromGregorianYear(2024, 'zh-CN')  // "龙"
      zodiacFromGregorianYear(2024, 'zh-TW') // "龍"