c# 时间相减
public static string timediff(DateTime dateBegin, DateTime dateEnd) { TimeSpan ts1 = new TimeSpan(dateBegin.Ticks); TimeSpan ts2 = new TimeSpan(dateEnd.Ticks); TimeSpan ts3 = ts1-ts2; //你想转的格式 return ts3.TotalMilliseconds.ToString(); }
转载于:https://www.cnblogs.com/ssjsk/p/5551337.html