Hello, I am quite new here so I am not sure if I am on the right section.
I would like to place a server time clock inside a wordpress widget.
Now I came up with this code, its all included with the style and I would like to keep this style but this clock doesn’t show the server time but the client time.
[CODE]<!DOCTYPE html>
<html>
<head>
<script>
function startTime() {
var today=new Date();
var h=today.getHours();
var m=today.getMinutes();
var s=today.getSeconds();
m = checkTime(m);
s = checkTime(s);
document.getElementById(‘txt’).innerHTML = h+”:”+m+”:”+s;
var t = setTimeout(function(){startTime()},500);
}
function checkTime(i) {
if (i<10) {i = “0” + i}; // add zero in front of numbers < 10
return i;
}
</script>
</head>
<body onload=”startTime()”>
<div id=”txt” style=”background-color:transparent; font-family: ‘courier’, Helvetica, Arial, sans-serif; font-size: 20pt; color: #FFF;”></div>
</body>
</html>
Someone can help me with this code to show the server time rather than client time?
Thank you in advance.