for example:
time-A: 1749
time-B: 1555
how to count: how many minutes between time-A and time-B?
or is there VB library can do for this?
Printable View
for example:
time-A: 1749
time-B: 1555
how to count: how many minutes between time-A and time-B?
or is there VB library can do for this?
Assuming that the 24hour times will be 4 digits.Code:Private Sub Command1_Click()
Label1.Caption = DateDiff24Hr("1749", "1555")
End Sub
Function DateDiff24Hr(Time1 As String, Time2 As String)
Time1 = Left(Time1, 2) & ":" & Right(Time1, 2)
Time2 = Left(Time2, 2) & ":" & Right(Time2, 2)
DateDiff24Hr = DateDiff("n", Time2, Time1)
End Function