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
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.

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