在页面上显示当前时间并同步更新

pink12345 2004-09-14 05:34:17
用vbscript在页面上显示当前时间

并且显示的时间要1秒种刷新一次

就是说显示的是时间和当前时间是同步的

请问用vbscript怎么写?用什么函数?
...全文
138 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
intergameover 2004-09-14
  • 打赏
  • 举报
回复
楼上得不错
wzgme 2004-09-14
  • 打赏
  • 举报
回复
楼上的是js的。看我刚写的vbs的,简单了点啊。。
------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>钟</title>
<script language="VBScript">
<!--
//一风一云的vbs时钟演示
function showtime()
now_time=now()
liveclock.innerHTML=now_time
window.setTimeout "showtime()",1000,"vbscript"
end function
//-->
</script>
</head>
<body onLoad="showtime()" >
<span id=liveclock style=position:absolute;left:250px;top:122px;; width: 109px; height: 15px>
</span>
</body>
</html>
sinusoid 2004-09-14
  • 打赏
  • 举报
回复
http://www0.ccidnet.com/school/web/2001/04/30/70_4067.html
sinusoid 2004-09-14
  • 打赏
  • 举报
回复
<script>
function tick()
{
var hours, minutes, seconds, xfile;
var intHours, intMinutes, intSeconds;
var today;
today = new Date();
intHours = today.getHours();
intMinutes = today.getMinutes();
intSeconds = today.getSeconds();
if (intHours == 0)
{
hours = "12:";
xfile = "午夜";
}
else if (intHours < 12)
{
hours = intHours+":";
xfile = "上午";
}
else if (intHours == 12)
{
hours = "12:";
xfile = "正午";
}
else
{
intHours = intHours - 12
hours = intHours + ":";
xfile = "下午";
}
if (intMinutes < 10)
{
minutes = "0"+intMinutes+":";
}
else
{
minutes = intMinutes+":";
}
if (intSeconds < 10)
{
seconds = "0"+intSeconds+" ";
}
else
{
seconds = intSeconds+" ";
}
timeString = xfile+hours+minutes+seconds;
Clock.innerHTML = timeString;
window.setTimeout("tick();", 100);
}
window.onload = tick;
</script>
<span id="Clock">

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧