//DateTime currentTime = DateTime.Now;
//TimeSpan stepTime = currentTime.Subtract(_startTime);
//TimeSpan elapsedTime = currentTime.Subtract(_globalStartTime);
//_startTime = currentTime;
////TimeSpan span = new TimeSpan(;
//timePrevious = DateTime.Now;
//timeCurrent = DateTime.Now.AddDays(1);
//timeSubtracted = timeCurrent.Subtract(timePrevious).TotalMinutes
Use below.
Globals.txt2 = DateTime.Now.ToString("HH:mm:ss");
Globals.time2 = Convert.ToDateTime(Globals.txt2);
TimeSpan dt = Globals.time2.Subtract(Globals.time1);
string ttt = Globals.txt1 + " " + Globals.txt2 + " " + dt.Seconds.ToString();
//MessageBox.Show(ttt);
Globals.txt1 = Globals.txt2;
Globals.time1 = Convert.ToDateTime(Globals.txt1);
No comments:
Post a Comment