1. 程式人生 > >C#計算日期時間間隔

C#計算日期時間間隔

                      DateTime QNTime = DateTime.ParseExact(value.QN.Substring(0, 14), "yyyyMMddHHmmss", null);
                DateTime LocalTime = DateTime.Now;
                TimeSpan spantime = (QNTime - LocalTime);
                double spantime1 = spantime.TotalMinutes;