DateTime dt1 = Convert.ToDateTime("2010-10-1 10:01:30"); DateTime dt2 = Convert.ToDateTime("2010-10-2 10:02:40"); TimeSpan ts = dt2.Subtract(dt1); Console.WriteLine(ts.TotalSeconds);
c# 时间比较
最新推荐文章于 2023-04-15 23:49:17 发布
DateTime dt1 = Convert.ToDateTime("2010-10-1 10:01:30"); DateTime dt2 = Convert.ToDateTime("2010-10-2 10:02:40"); TimeSpan ts = dt2.Subtract(dt1); Console.WriteLine(ts.TotalSeconds);