I am new to c# and using windows forms. the result of this code is: 01:38:07.0093844
. Anyone knows how can I remove the millisecond part (0093844) from the result (ts) I want the result to look like this : 01:38:07
(H:mm:ss) without millisecond .
Please help .Thank you
string OldDateTime = "2016-03-02 13:00:00.597"; //old DateTime
DateTime CurrentDateTime = DateTime.Now;
TimeSpan ts = CurrentDateTime.Subtract(Convert.ToDateTime(OldDateTime)); //Difference
//result of ts = 01:38:07.0093844