2016年6月2日 星期四

[asp.net]一些日期應用

//取得 上個月月底的天數 
string lastMonth = DateTime.DaysInMonth(DateTime.Now.Year, DateTime.Now.AddMonths(-1).Month).ToString()

//取得現在時間的日期
int nowDate = DateTime.Now.Day

沒有留言:

張貼留言