C#获取农历 (转载)

 

ContractedBlock.gif ExpandedBlockStart.gif Code
using System.Globalization;

ChineseLunisolarCalendar cc 
= new ChineseLunisolarCalendar();
        
this.datetime.Text = DateTime.Today.ToString("yyyy年MM月dd日 ")
            
+ CultureInfo.CurrentCulture.DateTimeFormat.GetDayName(DateTime.Now.DayOfWeek) + " 农历"
            
+ CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(cc.GetMonth(DateTime.Today))
            
+ intTostring(cc.GetDayOfMonth(DateTime.Today));

以上输出为:2008年09月04日 星期四 农历八月初五

转载于:https://www.cnblogs.com/xiaotan68/archive/2009/05/14/1457061.html

你可能感兴趣的:(C#获取农历 (转载))