Need a method to get a digital clock without taking it from sites like 24timezones.com
<script src="http://24timezones.com/timescript/maindata.js.php?city=1595976"language="javascript"></script>**strong text**
<table width="8">
<tr>
<td width="83"><div id="flash_container_tt52b882f044241"></div>
<script type="text/javascript">
var flashMap = new SWFObject("http://24timezones.com/timescript/clock_digit_24.swf", "main", "1360", "70", "7.0.22", "#FFFFFF", true)
flashMap.addParam("movie", "http://24timezones.com/timescript/clock_digit_24.swf");
flashMap.addParam("quality", "high");
flashMap.addParam("wmode", "transparent");
flashMap.addParam("flashvars", "color=00CC00&logo=1&city=1595976");
flashMap.write("flash_container_tt52b882f044241");
</script></td>
</tr>
</table>
W3Schools has an excellent example in pure JavaScript:
<!DOCTYPE html>
<html>
<head>
<script>
function startTime()
{
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
// add a zero in front of numbers<10
h=checkTime(h);
m=checkTime(m);
s=checkTime(s);
document.getElementById('txt').innerHTML=h+":"+m+":"+s;
t=setTimeout(function(){startTime()},500);
}
function checkTime(i)
{
if (i<10)
{
i="0" + i;
}
return i;
}
</script>
</head>
<body onload="startTime()">
<div id="txt"></div>
</body>
</html>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With