c#对时间差,有一个专门的类进行封装,TimeSpan.cs;
System.DateTime pauseT=System.Convert.ToDateTime("2013-06-14 10:09:34");
System.DateTime resumeT=System.DateTime.Now;
// 现在时间:2013-06-14 11:19:38
Debug.Log(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
System.TimeSpan ts1=new System.TimeSpan(pauseT.Ticks);
System.TimeSpan ts2=new System.TimeSpan(resumeT.Ticks);
System.TimeSpan tsSub=ts1.Subtract(ts2).Duration();
Debug.Log("resume List "+tsSub.Days+" "+tsSub.Hours+" "+tsSub.Minutes);
// resume List 0 1 10
tsSub.Days:相差天数;
tsSub.Hours:相差小时;
tsSub.Minutes:相差分钟;