Function test1() Debug.Print timeDiff(#6/18/2004 1:01:51 AM#, #6/28/2004 1:01:52 AM#) End Function Function timeDiff(dteStart As Date, dteEnd As Date) As String Dim lngDiff As Long Dim strCheck(3) lngDiff = DateDiff("s", dteStart, dteEnd) strCheck(0) = CStr(lngDiff Mod 60) & "秒" strCheck(1) = CStr(lngDiff \ 60 Mod 60) & "分" strCheck(2) = CStr(lngDiff \ 60 \ 60 Mod 24) & "小時" strCheck(3) = CStr(lngDiff \ 60 \ 60 \ 24) & "天" Dim i As Integer For i = 0 To 3 If Left(strCheck(i), 1) = "0" Then strCheck(i) = "" End If Next timeDiff = strCheck(3) & strCheck(2) & strCheck(1) & strCheck(0) End Function |