系统时间
来源:互联网 发布:3dmax软件 编辑:程序博客网 时间:2024/06/05 20:03
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>时间</title>
</head>
<body>
<h3>当前时间:<span id="time"></span></h3>
<button onClick="fun1()">暂停</button>
<button onClick="fun2()">开始</button>
<script>
function fun1(){
window.clearInterval(timea);
}
function fun2(){
timea=window.setInterval(show(),1000);
}
function show(){
var date = new Date();
var hour = date.getHours();
var minutes = date.getMinutes();
var second = date.getSeconds();
if(hour<10){
hour = "0"+hour;
}
if(minutes<10){
minutes = "0"+minutes;
}
if(second<10){
second = "0"+second;
}
var time = hour+":"+minutes+":"+second;
var span = document.getElementById("time");
span.innerHTML = time;
return show;
}
var timea = window.setInterval(show(),1000);
</script>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>时间</title>
</head>
<body>
<h3>当前时间:<span id="time"></span></h3>
<button onClick="fun1()">暂停</button>
<button onClick="fun2()">开始</button>
<script>
function fun1(){
window.clearInterval(timea);
}
function fun2(){
timea=window.setInterval(show(),1000);
}
function show(){
var date = new Date();
var hour = date.getHours();
var minutes = date.getMinutes();
var second = date.getSeconds();
if(hour<10){
hour = "0"+hour;
}
if(minutes<10){
minutes = "0"+minutes;
}
if(second<10){
second = "0"+second;
}
var time = hour+":"+minutes+":"+second;
var span = document.getElementById("time");
span.innerHTML = time;
return show;
}
var timea = window.setInterval(show(),1000);
</script>
</body>
</html>
阅读全文
0 0
- 系统时间
- 系统时间
- 时间系统
- 系统时间
- 系统时间
- 系统时间
- 系统时间
- 系统时间
- 系统时间
- 系统时间
- 系统时间
- 系统时间
- 系统时间
- 系统时间
- 系统时间及时间格式
- CPU 用户时间 系统时间
- 文件时间与系统时间
- CPU 用户时间 系统时间
- 四周第四次课 2017.11.09 压缩打包介绍、gzip压缩工具、bzip2压缩工具、xz压缩工具
- 洛谷P3368 【模板】树状数组 2
- hdu 1789Doing Homework again
- java常见异常分类
- ToolBar加DrawerLayout加Fragment实现侧滑菜单
- 系统时间
- TensorFlow学习笔记10——TensorFlow保存和调用模型遇到的问题
- redis学习(一)——redis介绍及安装
- 泛型的概念以及泛型的使用
- 文章标题
- 【poj3254】Corn Fields
- hdfs所有nameNode都是standby,zkfc 进程锁启动不了。
- GYM 100962F Problem F. Frank Sinatra(树上莫队+分块)
- 接口 动物声音模拟器