فاصله زمانی بین 2 زمان مختلف در یک روز با VB6
''''''''''''''''''''''''''''''''''''
' 00:00:00 '
''''''''''''''''''''''''''''''''''''
Private Sub Command1_Click()
Dim h1, m1, s1 As String
Dim time1 As Long
h1 = Mid(Text1.Text, 1, 2)
m1 = Mid(Text1.Text, 4, 2)
s1 = Mid(Text1.Text, 7, 2)
time1 = (Val(h1) * 60 * 60) + (Val(m1) * 60) + Val(s1)
'''''''''''''''''''''''''''''''''''''
Dim h2, m2, s2 As String
Dim time2 As Long
h2 = Mid(Text2.Text, 1, 2)
m2 = Mid(Text2.Text, 4, 2)
s2 = Mid(Text2.Text, 7, 2)
time2 = (Val(h2) * 60 * 60) + (Val(m2) * 60) + Val(s2)
''''''''''''''''''''''''''''''''''''''
Dim h3, m3, s3 As Integer
Dim newtime As Long
newtime = time2 - time1
h3 = Int(newtime / 3600)
m3 = Int((newtime Mod 3600) / 60)
s3 = Int(((newtime Mod 3600) Mod 60))
''''''''''''''''''''''''''''''''''''''
Text3 = Str(h3) + ":" + Str(m3) + ":" + Str(s3)
'''''''''''''''''''''''''''''''''''''