I want to calculate the time span between 2 times which I saved in a database. So literally I want to know the length of time between the 2 values.
14:10:20 – 10:05:15 = 02:05:05
So the result would be 02:05:05.
How would I be able to achieve this using C#?
14:10:20 is the format I saved it in in my database.
Read the two time values into TimeSpan variables, then perform a
.Subtract()on the bigger TimeSpan variable to get the TimeSpan result.E.g.
TimeSpan difference = t1.Subtract(t2);.