Function uf_TimeDiff(dtmStart As Date, dtmEnd As Date) As String
Dim t As Long
Dim strTime(3)
t = DateDiff("s", dtmStart, dtmEnd)
strTime(0) = CStr(t Mod 60) & "秒"
strTime(1) = CStr(t \ 60 Mod 60) & "分"
strTime(2) = CStr(t \ 60 \ 60 Mod 24) & "小时"
strTime(3) = CStr(t \ 60 \ 60 \ 24) & "天"
Dim i As Integer
For i = 0 To 3
If Left(strTime(i), 1) = "0" Then
strTime(i) = ""
End If
Next
uf_TimeDiff = strTime(3) & strTime(2) & strTime(1) & strTime(0)
End Function
Access软件网交流QQ群(群号:198465573) |