名站网址导航为大家提供关于网站网页设计设计相关的的教程知识。
- 本篇文章具体介绍如下
具体代码如下:
<div id="showTime"></div>
javascript 具体代码如下:时间显示格式为:2011-04-04 星期二 12:09:34
具体代码如下:
function startTime() {
try{
var today = new Date();
var year = today.getFullYear();
var month = checkNum(today.getMonth() 1);
var date = checkNum(today.getDate());
var day = today.getDay();
var hour = checkNum(today.gethours());
var minute = checkNum(today.getMinutes());
var second = checkNum(today.getSeconds());
switch(day) {
case 1:
day = "一";
break;
case 2:
day = "二";
break;
case 3:
day = "三";
break;
case 4:
day = "四";
break;
case 5:
day = "五";
break;
case 6:
day = "六";
break;
case 7:
day = "日";
break;
}
var fullTime = year "-" month "-" date " " "星期" day " " hour ":" minute ":" second;
document.getElementById("showTime").innerhTML = fullTime;
setInterval('startTime()', 1000);
}catch(e) {
alert(e.description);
}
}
function checkNum(num) {
if(num<10) {
num = "0" num;
}
return num;
}
好了关于网站网页设计设计相关的这篇文章就给大家介绍到这里不明白的地方给本站留言。声明,本站内容来源于互联网,如果侵犯了你的权益请联系本站删除。,jquery向.ashx文件post中文乱码问题的解决方法-jquery