javascript 显示时间
来源:互联网 发布:mac ui设计软件 编辑:程序博客网 时间:2024/05/17 00:16
<script>
function tick() {
var hours, minutes, seconds, xfile;
var intHours, intMinutes, intSeconds;
var today, theday;
today = new Date();
function initArray(){
this.length=initArray.arguments.length
for(var i=0;i<this.length;i++)
this[i+1]=initArray.arguments[i] }
var d=new initArray(
" 星期日",
" 星期一",
" 星期二",
" 星期三",
" 星期四",
" 星期五",
" 星期六");
theday = today.getYear()+"-" + [today.getMonth()+1]+"-" +today.getDate() + d[today.getDay()+1];
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 = theday+xfile+hours+minutes+seconds+"紧急"+intHours;
timeString = theday+" "+intHours+":"+intMinutes+":"+intSeconds;
Clock.innerHTML = timeString;
window.setTimeout("tick();", 100);
}
window.onload = tick;
</script>
调用
<div id="Clock" align="center" style="font-size: 12px; color:#000000"></div>
- javascript 显示客户端时间
- javascript 显示时间
- javascript 显示时间
- 【JavaScript】时间显示
- javascript显示日期时间
- JavaScript显示当前时间
- javascript显示时间
- javascript动态显示时间
- javascript 显示时间
- JavaScript 显示时间
- javaScript实现时间显示...
- javascript显示年月日时间
- javascript动态显示时间
- JavaScript 时间显示
- JavaScript显示系统时间
- javascript 显示当前时间
- javascript显示时间
- Javascript 显示时间
- 今天去献血啦,在这里做一回义务献血宣传员吧 ^_^
- APMServ 5.2.0 服务器平台搭建工具
- 07年12月29(晚上)
- 2007年的流水账
- 俺不是程序员
- javascript 显示时间
- getopt()函数介绍
- 操作系统(六)
- Apache (httpd)服务器防DDOS模块mod_evasive
- 在AIX下安装emacs23
- 在Eclipse中使用Ant来自动编译J2me程序
- ZOJ-1067-Color Me Less
- 搭建开发平台Eclipse
- 指针数组