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();
}
}
公历转农历函数
最新推荐文章于 2023-08-20 21:13:26 发布