These two TimeSpan are stored in the Database with 24hr format. No date, only TimeSpan.
Dim r As TimeSpan
Dim tsStart As TimeSpan
Dim tsEnd As TimeSpan
'tsStard is 12:27:30 (pm) this happened first
'tsEnd is 00:10:25 (am) then this happened later
'You can't store 24:10:25 in the column type Time(7)
r = tsEnd.Subtract(tsStart)
‘the r = -12:17:05
Is there any TimeSpan method to get this right? Thank you.
If you know that
tsEndalways represents a later point in time thantsStartbut your database doesn’t store the dates, you can solve this by adding 24 hours to the end when the end is less than the start (pardon the C# syntax):As jball noted in the comments, this assumes that
tsEndis never later by more than one day, though we have no way to determine otherwise.