function tokei() {
now = new Date();
year = now.getYear();
month = now.getMonth()+1;
day = now.getDate();
wday=now.getDay();
hour = now.getHours();
minute = now.getMinutes();
second = now.getSeconds();
youbi= new Array("日","月","火","水","木","金","土");

if (year < 1000) { year += 1900 }
if (hour < 10) { hour = '0' + hour }
if (minute < 10) { minute = '0' + minute }
if (second < 10) { second = '0' + second }
/*if (wday==0) {wday='日'}
if (wday==1) {wday='月'}
if (wday==2) {wday='火'}
if (wday==3) {wday='水'}
if (wday==4) {wday='木'}
if (wday==5) {wday='金'} 
if (wday==6) {wday='土'}*/
document.form.tokei.value = year+'年' + month + '月' + day + '日 '+ youbi[wday] +'曜日'+ hour + ':' + minute + ':' + second;
setTimeout("tokei()",1000);/*この行は繰り返すので時間が変わる*/
}
/*if文はコメントアウトして、new Arrayを使ってみた*/