TimeSpan
using System; using System.Timers; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var time1 = "2010-5-26 8:10:00"; var time2 = "2013-4-11 15:49:00"; var t1 = Convert.ToDateTime(time1); var t2 = Convert.ToDateTime(time2); var timeSpan = t1 - t2; Console.WriteLine(timeSpan.Hours); Console.WriteLine(timeSpan.TotalHours); Console.WriteLine(timeSpan.Minutes); Console.WriteLine(timeSpan.TotalMinutes); Console.WriteLine(t1 - t2); var timeSpan1 = t2 - DateTime.Now; var timer = new Timer(1000); timer.Elapsed += (obj, ergs) => { Console.WriteLine(timeSpan1.TotalSeconds); timeSpan1 = t2.Subtract(DateTime.Now); }; timer.Start(); Console.WriteLine("time out."); Console.Read(); } } }