<SCRIPT TYPE="text/JavaScript"> <!-- var Youbi = new Array(7); // (1) Youbi[0] = "日"; Youbi[1] = "月"; Youbi[2] = "火"; Youbi[3] = "水"; Youbi[4] = "木"; Youbi[5] = "金"; Youbi[6] = "土"; function Time() { var msg, year, month, date, day, hour, min, sec; Now = new Date(); // (2) year = Now.getYear(); month = Now.getMonth() + 1; // 0〜11 が返るので +1 しています。 date = Now.getDate(); day = Now.getDay(); hour = Now.getHours(); min = Now.getMinutes(); sec = Now.getSeconds(); msg = year + "年" + month + "月" + date + "日" + "(" + Youbi[dayt] + ")" + "\n" + hour + "時" + min + "分" + sec + "秒" document.tm.val.value = msg; setTimeout( "Time()", 1000); // (3) } //--> </SCRIPT> <FORM NAME="tm"> Time Information<BR> <TEXTAREA NAME="val" ROWS="2" COLS="20"> </TEXTAREA> </FORM> <SCRIPT TYPE="text/JavaScript"> <!-- Time(); //--> </SCRIPT> |