Format a lunar date using a pattern string
Pattern tokens: ┌──────────────────────────────────────────────────────────┐ │ 农历相关 │ │ {CY} - Cycle number (e.g., "78") │ │ {Y} - Year in cycle (e.g., "34") │ │ {Ygz} - Year GanZhi (e.g., "丁酉") │ │ {Z} - Zodiac animal (e.g., "鸡") │ │ {M} - Lunar month number (e.g., "7") │ │ {Mname} - Lunar month name (e.g., "七月") │ │ {L} - Leap indicator (e.g., "闰"/"閏") │ │ {D} - Lunar day number (e.g., "28") │ │ {Dname} - Lunar day name (e.g., "廿八") │ ├──────────────────────────────────────────────────────────┤ │ 公历相关 │ │ {GY} - Gregorian year (e.g., "2025") │ │ {GYcn} - Gregorian year in Chinese 〇 (e.g., "二〇二五") │ │ {GYcn2} - Gregorian year in Chinese 零 (e.g., "二零二五") │ │ {GM} - Gregorian month (e.g., "10") │ │ {GM0} - Gregorian month zero-padded (e.g., "03") │ │ {GMcn} - Gregorian month in Chinese (e.g., "十") │ │ {GD} - Gregorian day (e.g., "11") │ │ {GD0} - Gregorian day zero-padded (e.g., "01") │ │ {GDcn} - Gregorian day in Chinese (e.g., "十一") │ ├──────────────────────────────────────────────────────────┤ │ 星期相关 │ │ {W} - Weekday number 0-6 (e.g., "6") │ │ {Wname} - Weekday full name (e.g., "星期六") │ │ {Wshort} - Weekday short name (e.g., "六") │ └──────────────────────────────────────────────────────────┘
Lunar date value
Julian Ephemeris Day
Format pattern string (see token table above)
Optionallocale: LocaleCodeLocale code (optional, default 'zh-CN')
Date formatting with pattern tokens. See PATTERNS for presets and the format function docs for the full token reference table.