|
|
|
7i24.Com不停为您服务
时间格式应为:MM/DD/YYYY HH:MM:SS
<%
Function CountDown(dtmWhenEnds)
Dim dtmNow
Dim strTimeLeft
Dim intDiffsR
Dim intDiffmR
Dim intDiffhR
Dim intDiffdR
Dim intDiffsA
Dim intDiffmA
Dim intDiffhA
Dim intDiffdA
Dim strDayS
Dim strHourS
Dim strMinuteS
Dim strSecondS
dtmNow = Now()
If dtmWhenEnds > dtmNow Then
intDiffsR = DateDiff("s", dtmNow, dtmWhenEnds)
intDiffmR = intDiffsR \ 60
intDiffhR = intDiffmR \ 60
intDiffdR = intDiffhR \ 24
intDiffsA = intDiffsR - (intDiffmR * 60)
intDiffmA = intDiffmR - (intDiffhR * 60)
intDiffhA = intDiffhR - (intDiffdR * 24)
intDiffdA = intDiffdR
If intDiffdA = 1 Then
strDayS = " Day, "
Else
strDayS = " Days, "
End If
strTimeLeft = strTimeLeft & intDiffdA & strDayS
If intDiffhA = 1 Then
strHourS = " Hour, "
Else
strHourS = " Hours, "
End If
strTimeLeft = strTimeLeft & intDiffhA & strHourS
If intDiffmA = 1 Then
strMinuteS = " Minute, "
Else
strMinuteS = " Minutes, "
End If
strTimeLeft = strTimeLeft & intDiffmA & strMinuteS
If intDiffsA = 1 Then
strSecondS = " Second "
Else
strSecondS = " Seconds "
End If
strTimeLeft = strTimeLeft & intDiffsA & strSecondS
Else
strTimeLeft = "Countdown has ended"
End If
CountDown = strTimeLeft
End Function
%>
|
|
|