Dim StartTrip AsLong = DateTime.TimeParse("08:00:00")
Dim EndTrip AsLong = DateTime.TimeParse("18:30:00")
Dim MovementTime AsLong = DateTime.TimeParse("7:15:00")
Dim TripDuration AsLong = EndTrip - StartTrip
Dim StopTime AsLong = TripDuration - MovementTime
Please use [ code ] [ /code ] tags (without spaces) when posting code.
1. You should use DateUtils to calculate the time difference.
2. Convert the Period to string with this code:
B4X:
Sub PeriodToString(p As Period) As String
Return NumberFormat(p.Hours, 2, 0) & ":" & NumberFormat(p.Minutes, 2, 0) & ":" & _
NumberFormat(p.Seconds, 2, 0)
End Sub