public int GetTimeSpan(DateTime dtStart, DateTime dtEnd)
{
TimeSpan tsStart = new TimeSpan(dtStart.Ticks);
TimeSpan tsEnd = new TimeSpan(dtEnd.Ticks);
TimeSpan ts = tsEnd.Subtract(tsStart).Duration();//秒
//dateDiff = ts.Days.ToString() + "天" + ts.Hours.ToString() + "小时" + ts.Minutes.ToString() + "分钟" + ts.Seconds.ToString() + "秒";
return ts.Seconds;
}
新闻热点
疑难解答