" JCO" <J.********@verizon.net> wrote in message
news:ZW*****************@nwrddc03.gnilink.net...
How do you do this. I would like for it to be as dynamic as each page
refresh.
Thanks
Will this help? Test as-is; watch for word-wrap.
<html>
<head>
<title>time.htm</title>
</head>
<body>
<script type="text/javascript">
document.write('<span id="clock"></span>');
isNS4 = (document.layers) ? true : false;
isIE4 = (document.all && !document.getElementById) ? true : false;
isIE5 = (document.all && document.getElementById) ? true : false;
isNS6 = (!document.all && document.getElementById) ? true : false;
var clock = "";
if (isNS4) {
clock = document.layers["clock"];
} else if (isIE4) {
clock = document.all["clock"];
} else if (isIE5 || isNS6) {
clock = document.getElementById("clock");
}
function clockTick() {
var Now = new Date();
var Nhh = Now.getHours();
var Nnn = Now.getMinutes();
if (Nnn < 10) Nnn = "0" + Nnn;
var Nss = Now.getSeconds();
if (Nss < 10) Nss = "0" + Nss;
var Nap = "AM";
if (Nhh >= 12) {
Nhh -= 12;
Nap = "PM";
}
if (Nhh == 0) Nhh = 12;
var Str = new Array();
Str[0] = "<font color='#000000'>";
Str[9] = Nhh;
Str[10] = ":";
Str[11] = Nnn;
Str[12] = ":";
Str[13] = Nss;
Str[14] = " ";
Str[15] = Nap;
Str[16] = "</font> ";
var Clock = Str.join("");
clock.innerHTML = Clock;
}
setInterval("clockTick()",1000);
</script>
</body>
</html>
P.S. I'm sure someone will "refine" it!