You can get the difference between two DateTime objects using the following:
TimeSpan timePassed = timeOut.Subtract(timeIn);
where timeOut
and timeIn
are DateTime
objects.
If you need the difference (or either of the times) displayed somewhere as a string, I would recommend converting them to strings only after doing the calculations that you need. Always work with strongly typed objects when possible.