嗨,任何人都可以在这段代码中帮助我吗?我的错误是(“输入字符串的格式不正确”)
我的 lblmonin.text 有 ("hh:mm:ss") 格式和 lblmonout.text ("hh:mm:ss") 格式
Dim TimeA As Date Dim TimeB As Date Dim hh As Integer Dim mm As Integer Dim ss As Integer
'Calculation for Monday
If Not Date.TryParse(lblmonin.Text, TimeA) Then
End If
If Not Date.TryParse(lblmonout.Text, TimeB) Then
End If
hh = TimeB.Subtract(TimeA).Hours
mm = TimeB.Subtract(TimeA).Minutes
ss = TimeB.Subtract(TimeA).Seconds
Dim span As New TimeSpan
span = TimeSpan.Parse(TimeB.ToShortTimeString) - TimeSpan.Parse(TimeA.ToShortTimeString)
lblmontotal.Text = span.ToString