js的时间展示
<script type="text/javascript">
$(function() {
//方法调用
showtime();
//默认加载首页
$("#nav_menu").find("a")[0].click();
});
function editCurrentUserPwd() {
parent.$.modalDialog({
title : '修改密码',
width : 600,
height : 300,
href : '${pageContext.request.contextPath}/user/editCurrentUserPwdUI.jspx'
});
}
var weekdays = new Array("星期日", "星期一", "星期二","星期三","星期四", "星期五","星期六");
function showtime(){
var today=new Date();
var year = today.getFullYear();
var month = today.getMonth() + 1;
var day = today.getDate();
var h=today.getHours();
var m=checkTime(today.getMinutes());
var s=checkTime(today.getSeconds());
document.getElementById("timebox").innerHTML = "今天是 " + year + " 年 " + month + " 月" + day + " 日 "
+ weekdays[today.getDay()] + " " + h+":"+m+":"+s;
setTimeout('showtime()', 500);
}
function checkTime(i)
{
if (i<10)
{i="0" + i}
return i
}
</script>
展示效果