[基础累积] C#计算时间差
TimeSpan nowTime = new TimeSpan(DateTime.Now.Ticks); TimeSpan nextTime = new TimeSpan(nextDispatchert.RegBeginTime.Ticks); TimeSpan gapTime = nowTime.Subtract(nextTime).Duration();
通过 gapTime 可以获取分钟,小时,秒,天
TimeSpan nowTime = new TimeSpan(DateTime.Now.Ticks); TimeSpan nextTime = new TimeSpan(nextDispatchert.RegBeginTime.Ticks); TimeSpan gapTime = nowTime.Subtract(nextTime).Duration();
通过 gapTime 可以获取分钟,小时,秒,天