﻿function showtime()
{
 var d = new Date();
 var Hours = d.getHours();
 var Mins = d.getMinutes()
 var Secs = d.getSeconds()
 setTimeout("showtime()",1000);
}
Stamp = new Date();
document.write('' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getYear() + '  ');
var Hours;
var Mins;
var Secs;
var Time;
Hours = Stamp.getHours();
if (Hours >= 12) {
Time = " P.M.";
}
else {
Time = " A.M.";
}

if (Hours > 12) {
Hours -= 12;
}

if (Hours == 0) {
Hours = 12;
}

Mins = Stamp.getMinutes();
Secs = Stamp.getSeconds();

if (Mins < 10) {
Mins = "0" + Mins;
}

 days = new Array(7)
    days[1] = "星 期 日";
    days[2] = "星 期 一";
    days[3] = "星 期 二"; 
    days[4] = "星 期 三";
    days[5] = "星 期 四";
    days[6] = "星 期 五";
    days[7] = "星 期 六";
    months = new Array(12)
    months[1] = "1 月";
    months[2] = "2 月";
    months[3] = "3 月";
    months[4] = "4 月";
    months[5] = "5 月";
    months[6] = "6 月";
    months[7] = "7 月";
    months[8] = "8 月";
    months[9] = "9 月";
    months[10] = "10 月"; 
    months[11] = "11 月";
    months[12] = "12 月";
    today = new Date(); day = days[today.getDay() + 1]

document.write(' ' +"&nbsp;" +"&nbsp;" + Hours + ":" + Mins + Time + "&nbsp;" + "&nbsp;" + "&nbsp;" + "&nbsp;" +day);

