日期:2014-05-16 浏览次数:20354 次
<script type="text/javascript"> Function TimeDiff(sBegin,sEnd) Dim iHourB, iMinuteB, iSecondB, iMiniSecondB Dim iHourE, iMinuteE, iSecondE, iMiniSecondE Dim dTimeB, dTimeE, dTimeDiff Dim iHour, iMinute, iSecond, iMiniSecond iHourB = clng(Left(sBegin, 2)) iMinuteB = clng(Mid(sBegin, 4, 2)) iSecondB = clng(Mid(sBegin, 7, 2)) iMiniSecondB = clng(Mid(sBegin, 10, 4)) iHourE = clng(Left(sEnd, 2)) iMinuteE = clng(Mid(sEnd, 4, 2)) iSecondE = clng(Mid(sEnd, 7, 2)) iMiniSecondE = clng(Mid(sEnd, 10, 4)) dTimeB = iHourB * 3600 + iMinuteB * 60 + iSecondB + iMiniSecondB / 1000 dTimeE = iHourE * 3600 + iMinuteE * 60 + iSecondE + iMiniSecondE / 1000 dTimeDiff = dTimeE - dTimeB iHour = Int(dTimeDiff / 3600) dTimeDiff = dTimeDiff - iHour * 3600 iMinute = Int(dTimeDiff / 60) dTimeDiff = dTimeDiff - iMinute * 60 iSecond = Int(dTimeDiff) dTimeDiff = dTimeDiff - Int(dTimeDiff) iMiniSecond = dTimeDiff TimeDiff = iHour & "小时" & iMinute & "分钟" & iSecond & FormatNumber(iMiniSecond, 3) & "秒" document.getElementById("sj").value=TimeDiff; End Function </script>