﻿// JScript 文件

function Year_Month(){ 
	var now = new Date(); 
	var mm = now.getMonth()+1; 
	return(mm ); }
 
function thisYear(){ 
	var now = new Date(); 
	var yy = now.getYear(); 
	return(yy ); }
 
 function Date_of_Today(){ 
	var now = new Date(); 
	return(now.getDate() ); }
 
 function CurentTime(){ 
	var now = new Date(); 
	var hh = now.getHours(); 
	var mm = now.getMinutes(); 
	var ss = now.getTime() % 60000; 
	ss = (ss - (ss % 1000)) / 1000; 
	var clock = hh+':'; 
	if (mm < 10) clock += '0'; 
	clock += mm+':'; 
	if (ss < 10) clock += '0'; 
	clock += ss;
	return (clock);
}
function GetWeek() {
    var weekText = "";
    var todayDate = new Date();
    if (todayDate.getDay() == 5) weekText = ("星期五");
    if (todayDate.getDay() == 6) weekText = ("星期六");
    if (todayDate.getDay() == 0) weekText = ("星期日");
    if (todayDate.getDay() == 1) weekText = ("星期一");
    if (todayDate.getDay() == 2) weekText = ("星期二");
    if (todayDate.getDay() == 3) weekText = ("星期三");
    if (todayDate.getDay() == 4) weekText = ("星期四");
    return weekText; 
}
 
function refreshCalendarClock(){
    document.getElementById("calendarClock1").innerHTML = Year_Month();
    document.getElementById("calendarClock2").innerHTML = Date_of_Today();
    document.getElementById("calendarClock3").innerHTML = thisYear();
    document.getElementById("calendarClock4").innerHTML = GetWeek();
    //document.getElementById("calendarClock5").innerHTML = CurentTime();
    
}

document.write('<font id="calendarClock3" ></font>年');
document.write('<font id="calendarClock1" ></font>月');
document.write('<font id="calendarClock2" ></font>日&nbsp;&nbsp;&nbsp;');
document.write('<font id="calendarClock4" ></font>&nbsp;&nbsp;&nbsp;');
//document.write('<font id="calendarClock5" ></font>');

//refreshCalendarClock();
setInterval('refreshCalendarClock()',1000);
