Ganzhi.NET

Lunar conversion, minute-precision solar terms, Ganzhi four pillars, zodiac and lunar festivals — covering 1901-2100, astronomically computed and cross-verified. Zero dependencies, offline.

Core Features

🌙

Lunar Conversion 1901-2100

Bidirectional Gregorian↔lunar conversion; leap months explicitly flagged, non-existent dates gracefully rejected via TryToSolar.

☀️

Minute-precision Solar Terms

Computed from the full-precision VSOP87D ephemeris, verified minute-by-minute against USNO and observatory data; Taiwan time UTC+8.

🀄

Ganzhi Four Pillars

Year/month/day/hour pillars: selectable LiChun or Lunar-New-Year year boundary, month pillars switch at exact term times, late-Zi rule included.

🏮

Zodiac & Lunar Festivals

New Year's Eve, Lunar New Year, Lantern, Dragon Boat, Mid-Autumn and more — incl. the Laba two-or-zero-per-year edge case.

Quick Start

1. Install the package

dotnet add package Ozakboy.TaiwanKit.Ganzhi.NET

2. Lunar dates & solar terms

using Ozakboy.TaiwanKit.Ganzhi.NET;

// 國曆 ↔ 農曆
LunarDate lunar = LunarConverter.ToLunar(new DateTime(2026, 2, 17));
// → "2026年正月初一"

// 節氣(精確到分,台灣時間)
SolarTerms.GetExactTime(2026, SolarTerm.LiChun);   // 2026-02-04 04:02

3. Ganzhi & festivals

// 干支四柱(年柱可選立春/初一界線)
FourPillars p = GanzhiCalendar.GetFourPillars(new DateTime(2026, 2, 20, 10, 0, 0));
// p.Year.ChineseName → "丙午"、p.Month.ChineseName → "庚寅"

// 生肖與農曆節日
GanzhiCalendar.GetZodiac(new DateTime(2026, 6, 1));            // Horse(馬)
LunarFestivals.GetFestivalDate(2026, LunarFestival.MidAutumn); // 2026-09-25