Text3.Text = Format(DateDiff("s", a, b), "00:00:00")
改成如下:
Text3.Text = Format(b - a, "hh:mm:ss")
Dim a As Date
Dim b As Date
Private Sub Command1_Click()
a = Time
Text1.Text = a
End Sub
Private Sub Command2_Click()
b = Time
Text2.Text = b
Text3.Text = Format(DateDiff("s", a, b), "00:00:00")
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Command2_Click()
b = Time
Text2.Text = b
tt = DateDiff("s", a, b)
TmpH = tt \ 3600
TmpM = (tt Mod 3600) \ 60
TmpS = tt Mod 60
Text3.Text = Format(TmpH & ":" & TmpM & ":" & TmpS, "HH:MM:SS")
End Sub