class Program { static void Main(string[] args) { System.Globalization.ChineseLunisolarCalendar chineseLunisolarCalendar = new System.Globalization.ChineseLunisolarCalendar(); DateTime date = DateTime.Now; int year = chineseLunisolarCalendar.GetYear(date); int month = chineseLunisolarCalendar.GetMonth(date); int day = chineseLunisolarCalendar.GetDayOfMonth(date); Console.WriteLine(string.Format("公历:{0} 农历:{1}", date.ToString("yyyy-MM-dd"), (year + "-" + month + "-" + day))); Console.Read(); } }
时间: 2025-01-21 01:06:43