DateTime date1 = new DateTime(2005, 1, 22);
DateTime date2 = new DateTime(2005, 1, 19);
TimeSpan x = date1 - date2;
int result = (int)x.TotalDays;
转载于:https://www.cnblogs.com/ruiruizhang/archive/2010/01/16/1649133.html