一个用JS做的剩余时间表

js文件,是一个函数

function JSTime(vYear,vMonth,vDate,vHour,vMinute,vSecond, vState)
{
if (vState == 0)
{
//设置过期日期
var expireDate = new Date(vYear,vMonth-1,vDate,vHour,vMinute,vSecond);
//设置当前日期
var thisTime = new Date();
//总计剩余时间(毫秒)
var remainTime = expireDate-thisTime;
if(remainTime>0){
var remainDay,remainHour,remainMinute,remainSecond;
remainDay = Math.floor(remainTime/1000/3600/24);
remainTime = remainTime - (remainDay*1000*3600*24);
remainHour = Math.floor(remainTime/1000/3600);
remainTime = remainTime - (remainHour*1000*3600);
remainMinute = Math.floor(remainTime/1000/60);
remainTime = remainTime - (remainMinute*1000*60);
remainSecond = Math.floor(remainTime/1000);
remainTime = remainDay+"天"+remainHour+"小时"+remainMinute+"分"+remainSecond+"秒";
document.all["time"].innerHTML =remainTime;
}
else
document.all["time"].innerHTML ="竞拍结束";
}
else
if (vState == 1)
{
document.all["time"].innerHTML ="竞拍结束";
}
else
document.all["time"].innerHTML ="竞拍结束";
}

<%

tempt=rs("aucclosedate")

bbryear=year(tempt)
bbrmonth=month(tempt)
bbrday=day(tempt)
bbrhour=hour(tempt)
bbrminute=minute(tempt)
bbrsecond=second(tempt)if bbrstate="N" then
bbrstate=0
else
bbrstate=1
end if

Response.Write"<script>setInterval('JSTime("& bbryear &", "& bbrmonth &", "& bbrday &", "& bbrhour &", "& bbrminute &", "& bbrsecond &", "& bbrstate &")',1000);</script>" & vbcrlf

Response .Write "                    <tr> " & vbcrlf
Response .Write "                       <td height=22>剩余时间： <span id=time>正在计算...</span></td>" & vbcrlf
Response .Write "                      </tr>" & vbcrlf
%>

• 本文已收录于以下专栏：

举报原因： 您举报文章：一个用JS做的剩余时间表 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)