neelchauhan
04-23-2008, 12:44 PM
1) CODE TITLE: Basic Clock
2) AUTHOR NAME/NOTES:Windows Universe
3) DESCRIPTION: This is a very small clock that shows your local time and it does not use AJAX or PHP to fetch the time.
4) CODE:
<script>
var clockID = 0;
function updateclock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
var tDate = new Date();
document.getElementById('TheTime').innerHTML = ""
+ tDate.getHours() + ":"
+ tDate.getMinutes() + ":"
+ tDate.getSeconds();
clockID = setTimeout("updateclock()", 1000);
}
function StartClock() {
clockID = setTimeout("updateclock()", 500);
}
StartClock()</script>
<h1 style="background-color: blue; color: white; width: 120px; height: 40px; font-family: arial;" id="TheTime"></h1>
2) AUTHOR NAME/NOTES:Windows Universe
3) DESCRIPTION: This is a very small clock that shows your local time and it does not use AJAX or PHP to fetch the time.
4) CODE:
<script>
var clockID = 0;
function updateclock() {
if(clockID) {
clearTimeout(clockID);
clockID = 0;
}
var tDate = new Date();
document.getElementById('TheTime').innerHTML = ""
+ tDate.getHours() + ":"
+ tDate.getMinutes() + ":"
+ tDate.getSeconds();
clockID = setTimeout("updateclock()", 1000);
}
function StartClock() {
clockID = setTimeout("updateclock()", 500);
}
StartClock()</script>
<h1 style="background-color: blue; color: white; width: 120px; height: 40px; font-family: arial;" id="TheTime"></h1>