%
Function DownloadTime(intFileSize, strModemType)
Dim TimeInSeconds, ModemSpeed, strDownloadTime, AppendString
Dim intYears, intWeeks, intDays
Dim intHours, intMinutes, intSeconds
intYears = 0
intWeeks = 0
intDays = 0
intHours = 0
intMinutes = 0
intSeconds = 0
strDownloadTime = ""
Select Case strModemType
Case "Cable"
ModemSpeed = 400000
Case "56kbps"
ModemSpeed = 7000
Case "33.6kbps"
ModemSpeed = 4200
Case "28.8kbps"
ModemSpeed = 3600
End Select
TimeInSeconds = int(intFileSize / ModemSpeed)
' 準(zhǔn)確地說,1年=365.25天.
If (Int(TimeInSeconds / 31471200) > 0) Then intYears = Int(TimeInSeconds / 31449600)
If ((Int(TimeInSeconds / 604800) Mod 52) > 0) Then intWeeks = Int(TimeInSeconds / 604800) Mod 52
If ((Int(TimeInSeconds / 86400) Mod 7) > 0) Then intDays = Int(TimeInSeconds / 86400) Mod 7
If TimeInSeconds >= 3600 Then intHours = Int(TimeInSeconds / 3600) Mod 24
If TimeInSeconds >= 60 Then intMinutes = Int(TimeInSeconds / 60) Mod 60
If TimeInSeconds >= 0 Then intSeconds = Int(TimeInSeconds) Mod 60
If intYears > 0 Then
strDownloadTime = strDownloadTime intYears "年" AppendString ", "
End If
If intWeeks > 0 Then
strDownloadTime = strDownloadTime intWeeks "周" AppendString ", "
End If
If intDays > 0 Then
strDownloadTime = strDownloadTime intDays "日" AppendString ", "
End If
If intHours > 0 Then
strDownloadTime = strDownloadTime intHours "小時" AppendString ", "
End If
If intMinutes > 0 Then
strDownloadTime = strDownloadTime intMinutes "分" AppendString
End If
If ((intYears = 0) And (intWeeks = 0) And (intDays = 0) And (intHours = 0)) Then
If intMinutes > 0 Then
strDownloadTime = strDownloadTime ", " intSeconds "秒" AppendString
Else
strDownloadTime = strDownloadTime intSeconds "秒" AppendString
End If
End If
DownloadTime = strDownloadTime
End Function
%>
html>
body>
撼雪噴云提示:您下載這個文件一共花費(fèi)了%=DownloadTime(123456,Cable)%>.
/body>/html>
[1]
您可能感興趣的文章:- javascript實(shí)現(xiàn)的距離現(xiàn)在多長時間后的一個格式化的日期
- 將時間以距今多久的形式表示,PHP,js雙版本
- win2003或linux服務(wù)器一般多久重啟一次
- php實(shí)現(xiàn)用已經(jīng)過去多長時間的方式顯示時間
- 常見瀏覽器多長時間會提示“腳本運(yùn)行時間過長”總結(jié)
- 查看 MySQL 已經(jīng)運(yùn)行多長時間的方法
- 離22周歲距離多長時間的計算[適合沒到22周歲的朋友]
- iOS計算上次日期距離現(xiàn)在多久的代碼