DateTime start = DateTime.Now.AddDays(-20); DateTime end = DateTime.Now; TimeSpan ts = end.Subtract(start); double days = ts.TotalDays; int differentDays = (int)DateTime.Now.Subtract(start).TotalDays; bool result = days == differentDays; //输出 true