asp JavaScript倒计时问题

来源:百度知道 编辑:UC知道 时间:2024/05/08 09:51:54
我做了一个在线考试系统,里面想设置倒计时显示,我的思路如下,只是它只能设置一个日期才能有效,比如距离2009年1月1日还有多长时间,可是我想要设置具体的一段时间,比如考试时间为30分钟,如何修改?或者哪位朋友帮我重写一个,写好了我多加分,感激不尽!

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<DIV class=newsItem><B><ALIGN=CENTER><FONT color=blue>距离新年还有</B></FONT> <SPAN id=span_dt_dt style="BACKGROUND-COLOR: #ffffff; align: center no:1px solid black"></SPAN>
<SCRIPT language=javascript>
<!--
//document.write("");
function show_date_time(){

BirthDay=new Date("1-1-2009");//这个日期是可以修改的
today=new Date();
timeold=(BirthDay.getTime()-today.getTime());
sectimeold=timeold/1000
secondsold=Math.floor(sectimeold);

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<DIV class=newsItem><B><ALIGN=CENTER><FONT color=blue>距离新年还有</B></FONT> <SPAN id=span_dt_dt style="BACKGROUND-COLOR: #ffffff; align: center no:1px solid black"></SPAN>
<SCRIPT language=javascript>
<!--
//BirthDay=new Date("1-1-2009");
BirthDay=new Date();//这个日期是可以修改的
BirthDay.setMinutes(BirthDay.getMinutes()+30);
//document.write("");
function show_date_time(){

today=new Date();

timeold=(BirthDay.getTime()-today.getTime());
sectimeold=timeold/1000
secondsold=Math.floor(sectimeold);
msPerDay=24*60*60*1000
e_daysold=timeold/msPerDay<