C#计算两个日期的天数
2021-01-20 04:12
标签:ring 日期 span ret datetime convert day code tee C#计算两个日期的天数 标签:ring 日期 span ret datetime convert day code tee 原文地址:https://www.cnblogs.com/chenyanbin/p/12148766.html private int DateDiff(DateTime dateStart, DateTime dateEnd)
{
DateTime start = Convert.ToDateTime(dateStart.ToShortDateString());
DateTime end = Convert.ToDateTime(dateEnd.ToShortDateString());
TimeSpan sp = end.Subtract(start);
return sp.Days;
}