嗨,大家好
我为此做了很多搜索,但没有结果,所以我需要帮助!
我有两次这样的形式(“ hh:mm”)
像这样的前:
15:20-12:10 = 03:10
但采用其他形式的变量,因为时间不是固定的,而是保存在SQL DB中
我不知道这些变量应该是字符串还是日期和时间
a = dr!t_in
b = dr!t_out
msgbox(a-b) 'this shows the answer
许多坦克
使用TimeSpan
类的另一种方式。
Dim timeIn As String = "12:10"
Dim timeOut As String = "15:20"
MessageBox.Show(TimeSpan.Parse(timeOut).Subtract(TimeSpan.Parse(timeIn)).ToString(("hh\:mm")))
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句