C#获取两个日期之间天数

 

 

 

            DateTime dtLast = new DateTime(Convert.ToInt32(LastMenses.Year), Convert.ToInt32(LastMenses.Month), Convert.ToInt32(LastMenses.Day));


            DateTime dtThis = new DateTime(Convert.ToInt32(Year), Convert.ToInt32(thisMonth), Convert.ToInt32(Day));

 

            int interval = new TimeSpan(dtThis.Ticks - dtLast.Ticks).Days;

 

你可能感兴趣的:(C#)