﻿function time() {
    var date = new Date();
    var Year = date.getFullYear();
    var Months = date.getMonth()+1;
    var Day = date.getDate();

    var Weeks = new Array("星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");
    var Week = date.getDay();

    var div = document.getElementById("timeDiv")
    var time = Year + "年" + Whole(Months) + "月" + Whole(Day) + "日" + "　" + Weeks[Week];
    div.innerHTML = time;
    t = setTimeout('time()', 500)
}
function Whole(thisObj) {
    if (thisObj < 10) {
        thisObj = "0" + thisObj;
    }
    return thisObj
}
