DateTime dtStart = DateTime.Now;DateTime dtEnd = DateTime.Now;TimeSpan ts = dtStart.Subtract(dtEnd);ts.Days就是相差的天数。