I have two variables :
Dim starttime As TimeSpan
Dim endtime As TimeSpan
My starttime value is : 02:30:00 (I mean 2.30AM)
2.30AM is nex
You need to use a DateTime variable to hold your start time and end time. Like this:
Dim startTime As New DateTime(2013, 9, 19, 10, 30, 0) ' 10:30 AM today
Dim endTime As New DateTime(2013, 9, 20, 2, 0, 0) ' 2:00 AM tomorrow
Dim duration As TimeSpan = endTime - startTime 'Subtract start time from end time
Console.WriteLine(duration)
Result:
15:30:00
UPDATE:
To convert that result to minutes, you can use the TotalMinutes property of the TimeSpan variable:
Console.WriteLine(duration.TotalMinutes)
Result:
930