DateTime StartTime = DateTime.Now.ToLocalTime();
DateTime EndTime = DateTime.Now.ToLocalTime();
string dt = EndTime.Subtract(StartTime).ToString().Split('.')[0].ToString();
button1.Text = dt;
OutPut:
StartTime:8/7/2010 3:31:16 PM
EndTime:8/7/2010 3:32:07 PM
dt=00:00:50
How to find the Duration Time between two Times using C# ?
How to find the Duration Time between two Times using C#


Vivek JoyPosted Sep 21, 2015, 12:32 AM EDT
hello sir can you display the StartTime and EndTime in message box?