Đồng Hồ Điện Tử

rongcon

Công Thần CTIT
PHP:
<html><head><title>Preview - Date and Time / Digital Clock</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<STYLE>.clock {
	BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; COLOR: black; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: verdana; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #a6a98d
}
.time {
	FONT-SIZE: 100px
}
.clock TD {
	BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid; BORDER-COLLAPSE: collapse
}
B {
	COLOR: black
}
BODY {
	FONT-SIZE: 10pt; FONT-FAMILY: arial
}
</STYLE>
<!--This script downloaded from CongTruongIT.Com --> 
<SCRIPT language=JavaScript>
function time() {
var today = new Date();
var hrs = today.getHours();
var min = today.getMinutes();
var secs = today.getSeconds();
var alsohrs = today.getHours();
var dayNumber = today.getDate();
var year = today.getFullYear();
var ampm="";
var zero="0";
var month = today.getMonth() +1;
var weekday = today.getDay();
var wdn = new Array(7)
wdn[0] = "SUN";
wdn[1] = "MON";
wdn[2] = "TUE";
wdn[3] = "WED";
wdn[4] = "THU";
wdn[5] = "FRI";
wdn[6] = "SAT";
//Statement that puts '0's in front of single minutes or seconds.
if (min<10)
{
min=zero+min;
}
if (secs<10)
{
secs=zero+secs;
}
//Statement that eliminates Metric Time
if (hrs>12)
{
hrs=eval(hrs - 12);
}
if (hrs>=0 && hrs<1)
{
hrs=12
}
//P.M. Statement
if (alsohrs>=12 && alsohrs<24)
{
ampm="P.M.";
}
//A.M. Statement
if (alsohrs<12 && alsohrs>=0)
{
ampm="A.M.";
}
tmp='<table width="60%" class="clock"><tr><td class="time" colspan="4">';
tmp+=hrs+'<span id="blinker">:</span>'+min;
tmp+='<font size="20"> '+ampm+'</font>';
tmp+='<tr><td><font size="-1">Month</font><br><b>'+month+'</b></td>';
tmp+='<td><font size="-1">Date</font><br><b>'+dayNumber+'</b></td>';
tmp+='<td><font size="-1">Day</font><br><b>'+wdn[weekday]+'</b></td>';
tmp+='<td><font size="-1">Year</font><br><b>'+year+'</b></td></tr></table>';
document.getElementById("clockgoeshere").innerHTML=tmp;
clocktime=setTimeout("time()","1000");
}
function blink() {
var obj = document.getElementById("blinker");
if (obj.style.visibility == "visible") {
obj.style.visibility="hidden";
}
else {
obj.style.visibility="visible";
}
eachsecond=setTimeout("blink()","500");
}
</SCRIPT>
</head>
<body onload="time(); blink();" bgcolor="#FFFFFF" text="#000000">
<DIV id=clockgoeshere></DIV>
</body></html>
DEMO

 
Top