ASP+JS获取并实时显示服务器时间的代码

时间:2008-06-26 23:08:07  来源:  作者:

var z = w[mei.getDay()+1]//星期
var h = (mei.getHours() > 9) ? mei.getHours() : "0" + mei.getHours(); //时
var m = (mei.getMinutes() > 9) ? mei.getMinutes() : "0" + mei.getMinutes(); //分
var s = (mei.getSeconds() > 9) ? mei.getSeconds() : "0" + mei.getSeconds(); //秒
document.meizz.clock.value = y +" 年 "+ t +" 月 "+ d +" 日 " + z +" "+ h +":"+ m +":"+ s; //显示年月日和时间
setTimeout("meizzTime(secondSub)", 1000);
}
</script>
<meta http-equiv=’Content-Type’ content=’text/html; charset=gb2312’>
<meta http-equiv="refresh" content="1000">
<title>javascript + asp 获取并实时显示服务器时间</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<style type="text/css">
<!--
.form {
FONT-FAMILY:verdana,Arial, Helvetica;
FONT-SIZE: 9pt; color:#000000;
HEIGHT: 18px;
line-height:14px;
background:none;
border: none;
}
-->
</style>
</head>
<body onLoad="meizzTime(secondSub)">
<form name="meizz">
<input name="clock" size="100" class="form">
</form>
</body>
</html>

 

  因为我没有ASP空间,所以只有大家自己测试了!


Tags:


上一篇:没有了   下一篇:没有了

文章评论

共有 0人发表了评论 查看完整内容

推荐教程

最新教程