<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
倒计时 页面//document.write("");
function show_date_time() {
//alert('') ;
window.setTimeout("show_date_time()", 1000);
BirthDay = new Date("9/06/2013 08:30:00");//这个日期是可以修改的
today = new Date();
timeold = (BirthDay.getTime() - today.getTime());
sectimeold = timeold / 1000
secondsold = Math.floor(sectimeold);
msPerDay = 24 * 60 * 60 * 1000
e_daysold = timeold / msPerDay
daysold = Math.floor(e_daysold);
e_hrsold = (e_daysold - daysold) * 24;
hrsold = Math.floor(e_hrsold);
e_minsold = (e_hrsold - hrsold) * 60;
minsold = Math.floor((e_hrsold - hrsold) * 60);
seconds = Math.floor((e_minsold - minsold) * 60);
document.getElementById("span_dt_dt").innerHTML = ""
+ daysold
+ '天'
+ hrsold
+ '小时'
+ minsold
+ '分'
+ seconds
+ '秒'
+ "";
//"+daysold+"天"+hrsold+"小时"+minsold+"分"+seconds+"秒"+"
}
show_date_time();
距离2013年高考开始还有:
给你调整了一个,你自己再研究吧,如果对你有帮助,请给我分哦,嘻嘻
另外告诉你,在JS里面对“”很敏感,如果外面用了双引号,那么里面要用单引号, 不然出错,而且不提示,很不好查错,对JS兼容比较好的是FF浏览器, 在IE里面根本看不出错。
或者用/转译
想给你上传一张图片,可是我没有权限