C#获取农历 (转载)

 


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日 星期四 农历八月初五
posted on 2009-05-14 19:08  田田向上  阅读(724)  评论(1编辑  收藏  举报