我想知道2个日期之间的很多分钟?
示例:现在 - 确切时间的tommorow将返回1440.
DateTime dt1 = DateTime.Now; DateTime dt2 = DateTime.Now.AddDays(1); int diff = dt2.Subtract(dt1).TotalMinutes;
看看TimeSpan类.
DateTime date1 = DateTime.Now; DateTime date2 = DateTime.Now.AddDays(1); TimeSpan diff = date2.Subtract(date1); Console.WriteLine(diff.Minutes);