JS日期时间代码
来源:互联网 发布:说唱编辑软件 编辑:程序博客网 时间:2024/06/05 01:13
<!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=gb2312" />
<title>JavaScript在线时钟,时间</title>
<script type="text/javascript">
function tim(){
var now=new Date;
this.year = now.getFullYear();
this.tmonth = now.getMonth() + 1;
this.tday = now.getDate();
this.week = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六")[now.getDay()];
this.month = tmonth < 10 ? "0" + tmonth : tmonth;
this.day = tday < 10 ? "0" + tday : tday;
this.hour = now.getHours() < 10 ? "0" + now.getHours() : now.getHours();
this.minute = now.getMinutes() < 10 ? "0" + now.getMinutes() : now.getMinutes();
this.second = now.getSeconds() < 10 ? "0" + now.getSeconds() : now.getSeconds();
document.getElementById("timespan").innerHTML="今天是"+year+"年"+month+"月"+day+"日,"+hour+":"+minute+":"+second+","+week;
var mm=setTimeout("tim()","1000");
}
</script>
</head>
<body onLoad="tim()">
<span id="timespan"></span>
</body>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JavaScript在线时钟,时间</title>
<script type="text/javascript">
function tim(){
var now=new Date;
this.year = now.getFullYear();
this.tmonth = now.getMonth() + 1;
this.tday = now.getDate();
this.week = new Array("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六")[now.getDay()];
this.month = tmonth < 10 ? "0" + tmonth : tmonth;
this.day = tday < 10 ? "0" + tday : tday;
this.hour = now.getHours() < 10 ? "0" + now.getHours() : now.getHours();
this.minute = now.getMinutes() < 10 ? "0" + now.getMinutes() : now.getMinutes();
this.second = now.getSeconds() < 10 ? "0" + now.getSeconds() : now.getSeconds();
document.getElementById("timespan").innerHTML="今天是"+year+"年"+month+"月"+day+"日,"+hour+":"+minute+":"+second+","+week;
var mm=setTimeout("tim()","1000");
}
</script>
</head>
<body onLoad="tim()">
<span id="timespan"></span>
</body>
</html>
- JS日期时间代码
- 选择样式的日期时间js代码
- JS 取当前日期、时间的代码
- JS 取当前日期、时间的代码
- HTML显示日期时间代码 - [js 特效代码]
- JS 取当前日期、时间的代码
- JS 取当前日期、时间的代码
- JS 取当前日期、时间的代码
- JS 取当前日期、时间的代码
- JS (Javascript)取当前日期、时间的代码
- JS (Javascript)取当前日期、时间的代码
- js动态显示当前日期,时间和星期代码
- js动态显示当前日期,时间和星期代码
- JS (Javascript)取当前日期、时间的代码
- js动态显示当前日期,时间和星期代码
- 获取客户端电脑日期时间js代码(jquery)
- 好用便捷的js日期时间控件代码下载
- js获得当前日期和时间的代码
- 深入理解Linux内存映射机制
- JDK、IDE、J2EE等基本概念简单介绍
- Android: 缩放图片文件引起的OOM异常
- 程序员必知8大排序3大查找(二)
- IOS 对 .Net WebService 的调用 和上传文件
- JS日期时间代码
- 定义的指针一定要记得初始化,否则后果不堪设想。。。
- dithering
- 程序员必知8大排序3大查找(三)
- Sql 2005 建立作业自动备份的人工方法和程序代码!(经典)
- IE6遇到Nginx的gzip问题
- BFILENAME加载图片示例
- select()函数以及FD_ZERO、FD_SET、FD_CLR、FD_ISSET
- eclipse 配置python 开发环境