1、獲取當前時間
System.DataTime current = System.DateTime.Now;
2、時間間隔
TimeSpan ts1=newTimeSpan(DateTime1.Ticks);
TimeSpan ts2=newTimeSpan(DateTime2.Ticks);
TimeSpan ts=ts1.Subtract(ts2).Duration();
dateDiff=ts.Days.ToString()+"天" +ts.Hours.ToString()+"小時" +ts.Minutes.ToString()+"分鐘" +ts.Seconds.ToString()+"秒";