在网页上显示系统时间
来源:互联网 发布:网络常见端口号 编辑:程序博客网 时间:2024/05/01 16:00
<html>
<head>
<title>
Show the current time
</title>
<script>
var temp = null;
var timeValue = null;
function divCon()
{
temp = document.getElementById('thetime');
temp.innerText = "Time: " + timeValue;
}
var timerID = null;
var timerRunning = false;
function stopclock()
{
if(timerRunning)
{
clearTimeout(timerID);
}
timerRunning = false;
}
function startclock()
{
stopclock();
showtime();
}
function showtime()
{
var now = new Date(); //Get the current time
var hours = now.getHours(); //Get the current hours
var minutes = now.getMinutes(); //Get the current minutes
var seconds = now.getSeconds(); //Get the current seconds
timeValue = "" +((hours>12)?"PM ":"AM "); //以12?制?示系???
timeValue += ((hours>12)?hours-12:hours);
timeValue += ((minutes<10)?":0":":") + minutes; //以双位显示
timeValue += ((seconds<10)?":0":":") + seconds; //以双位显示
divCon();
timerID = setTimeout("showtime()",1000); //间隔1000毫秒,即1秒
timerRunning = true;
}
</script>
</head>
<body onload="divCon();startclock()">
<center>
<h1>TIME</h1>
<form name = "clock" id = "clock">
<div name="thetime" id ="thetime"></div>
</form>
</center>
</body>
</html>
- 在网页上显示系统时间
- 在网页上动态显示时间
- 使用js在网页上显示时间
- 在网页上动态显示当前时间
- 在页面上显示系统时间
- 用JavaScript实现在网页上动态显示时间
- 如何用js实现在网页上显示时间
- 网页上显示时间代码
- word显示在网页上
- PDF在网页上显示
- 图片根据数据库的时间(开始时间与结束时间)与本地时间相比,在网页上显示。
- JQuery实现网页上时间动态显示
- JavaScript总结-网页上显示时间
- 在屏幕上显示时间
- 用JavaScript在网页上显示时间,并可暂停和开始
- \t\tVC 在View上显示时间 (读取系统时间)
- 在网页中动态显示时间
- 在网页中动态显示时间
- 定义三维空间的一点及测量其它点到此点的距离
- 面对现状不知道怎么办
- 深入浅出C# 中文版 图文皆译 第四章 类型和引用 page132
- 防止SQL SERVER的事件探查器跟踪软件的SQL脚本
- LoadRunner出现error问题及解决方法总结
- 在网页上显示系统时间
- 音频的采集和播放(转)
- 中国超级牛人破译了美政府几乎所有密码!
- 动态添加无限级树
- oracle -- sqlserver
- 21天学通JAVA:类的定义和对象的创建
- MESSAGE_TYPE_X错误
- Linux 下网卡的配置(Linux学习笔记)
- 用Grails 开发了一点东西