|
- Function TimeSpan(dt1, dt2)
- If (isDate(dt1) And IsDate(dt2)) = false Then
- TimeSpan = "00:00:00"
- Exit Function
- End If
- seconds = Abs(DateDiff("S", dt1, dt2))
- minutes = seconds \ 60
- hours = minutes \ 60
- days = hours \ 24
- minutes = minutes mod 60
- seconds = seconds mod 60
- hours = hours mod 24
- if len(hours) = 1 then hours = "0" & hours
- TimeSpan = days& " 天 " & _
- RIGHT("00" & hours , 2) & " 小时 " & _
- RIGHT("00" & minutes, 2) & " 分钟"
- End Function
-
复制代码
完整demo演示:
日期差.asp
(845 Bytes, 下载次数: 0, 售价: 2 个ASP币)
|
|