在网页中显示实时时间,急!!!!!!!请说明怎么修改,谢谢
<!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.01Transitional//EN""http://www.w3.org/TR/html4/l...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width="160" border="0" cellspacing="0" cellpadding="0" height="30" id="table1">
<tr> <td valign="bottom" height="15"> <div align="center"></div></td></tr> <tr>
<td valign="bottom"><p>
<script language=JavaScript>
<!--
var date = new Date();
var day = date.getDate();
var month = date.getMonth()+1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
var week = date.getDay();
var hrs = date.getHours();
var hh, mm, ss;
var time, d;
d = new Date();
hh = d.getHours();
mm = d.getMinutes();
ss = d.getSeconds();
hh = (hh < 10)? "0" + hh : hh;
mm = (mm < 10)? "0" + mm : mm;
ss = (ss < 10)? "0" + ss : ss;
time = hh + ":" + mm + ":" + ss ;
document.write("<center>")
if (week == 5) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期五"+time+"<br>")
if (week == 6) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期六"+time+"<br>")
if (week == 0) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期日"+time+"<br>")
if (week == 1) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期一"+time+"<br>")
if (week == 2) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期二"+time+"<br>")
if (week == 3) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期三"+time+"<br>")
if (week == 4) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期四"+time+"<br>")
if (hrs<6) document.write(" 凌晨好")
else if (hrs<9) document.write(" 早上好")
else if (hrs<12) document.write(" 上午好")
else if (hrs<14) document.write(" 中午好")
else if (hrs<17) document.write(" 下午好")
else if (hrs<22) document.write(" 晚上好")
else if (hrs<24) document.write(" 深夜好")
//-->
</script>
</p>
</body>
</html>
要透明背景 展开
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<table width="160" border="0" cellspacing="0" cellpadding="0" height="30" id="table1">
<tr> <td valign="bottom" height="15"> <div align="center"></div></td></tr> <tr>
<td valign="bottom"><p>
<script language=JavaScript>
<!--
var date = new Date();
var day = date.getDate();
var month = date.getMonth()+1;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
var week = date.getDay();
var hrs = date.getHours();
var hh, mm, ss;
var time, d;
d = new Date();
hh = d.getHours();
mm = d.getMinutes();
ss = d.getSeconds();
hh = (hh < 10)? "0" + hh : hh;
mm = (mm < 10)? "0" + mm : mm;
ss = (ss < 10)? "0" + ss : ss;
time = hh + ":" + mm + ":" + ss ;
document.write("<center>")
if (week == 5) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期五"+time+"<br>")
if (week == 6) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期六"+time+"<br>")
if (week == 0) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期日"+time+"<br>")
if (week == 1) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期一"+time+"<br>")
if (week == 2) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期二"+time+"<br>")
if (week == 3) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期三"+time+"<br>")
if (week == 4) document.write(year+"年"+month+"月"+day+"日<br>"+" 星期四"+time+"<br>")
if (hrs<6) document.write(" 凌晨好")
else if (hrs<9) document.write(" 早上好")
else if (hrs<12) document.write(" 上午好")
else if (hrs<14) document.write(" 中午好")
else if (hrs<17) document.write(" 下午好")
else if (hrs<22) document.write(" 晚上好")
else if (hrs<24) document.write(" 深夜好")
//-->
</script>
</p>
</body>
</html>
要透明背景 展开
1个回答
展开全部
<!-- 网页特效代码由[树叶开心提供:http://www.lbsis007.com]提供! -->
<!-- 要实现此效果需要 2 个步骤: -->
<!-- 第 1 步: -->
<!-- 把<BODY>中的属性代码改为: -->
<BODY bgcolor="#fef4d9" onLoad="startclock()">
<!-- 第 2 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->
<script language="JavaScript">
<!-- Hide
var timerID = null
var timerRunning = false
function MakeArray(size)
{
this.length = size;
for(var i = 1; i <= size; i++)
{
this[i] = "";
}
return this;
}
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false
}
function showtime () {
var now = new Date();
var year = now.getYear();
var month = now.getMonth() + 1;
var date = now.getDate();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var day = now.getDay();
Day = new MakeArray(7);
Day[0]="星期天";
Day[1]="星期一";
Day[2]="星期二";
Day[3]="星期三";
Day[4]="星期四";
Day[5]="星期五";
Day[6]="星期六";
var timeValue = "";
timeValue += year + "年";
timeValue += ((month < 10) ? "0" : "") + month + "月";
timeValue += date + "日 ";
timeValue += (Day[day]) + " ";
timeValue += ((hours <= 12) ? hours : hours - 12);
timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
timeValue += (hours < 12) ? "上午" : "下午";
document.jsfrm.face.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true
}
function startclock () {
stopclock();
showtime()
}
//-->
</script>
<form name='jsfrm'>
<input type=text name='face' size=34 value=''>
</form>
<!-- 要实现此效果需要 2 个步骤: -->
<!-- 第 1 步: -->
<!-- 把<BODY>中的属性代码改为: -->
<BODY bgcolor="#fef4d9" onLoad="startclock()">
<!-- 第 2 步: -->
<!-- 把下面的代码加到<BODY></BODY>区域中: -->
<script language="JavaScript">
<!-- Hide
var timerID = null
var timerRunning = false
function MakeArray(size)
{
this.length = size;
for(var i = 1; i <= size; i++)
{
this[i] = "";
}
return this;
}
function stopclock (){
if(timerRunning)
clearTimeout(timerID);
timerRunning = false
}
function showtime () {
var now = new Date();
var year = now.getYear();
var month = now.getMonth() + 1;
var date = now.getDate();
var hours = now.getHours();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
var day = now.getDay();
Day = new MakeArray(7);
Day[0]="星期天";
Day[1]="星期一";
Day[2]="星期二";
Day[3]="星期三";
Day[4]="星期四";
Day[5]="星期五";
Day[6]="星期六";
var timeValue = "";
timeValue += year + "年";
timeValue += ((month < 10) ? "0" : "") + month + "月";
timeValue += date + "日 ";
timeValue += (Day[day]) + " ";
timeValue += ((hours <= 12) ? hours : hours - 12);
timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
timeValue += (hours < 12) ? "上午" : "下午";
document.jsfrm.face.value = timeValue;
timerID = setTimeout("showtime()",1000);
timerRunning = true
}
function startclock () {
stopclock();
showtime()
}
//-->
</script>
<form name='jsfrm'>
<input type=text name='face' size=34 value=''>
</form>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询