Debugging the time setting

When this page loads, the BODY tag executes bodyOnload($timeout) which, in turn, executes getAjaxDoc($timeout), which contacts the server with xmlhttp.open('GET','http://site2.caves.org.uk/clock/ajax_server_time.php?t=' + Math.random(),true). Click here to see that process in operation. Typically the server will return a string like 1398943564.6011.

Javascript fetches the local time via var timeNow = new Date(); var $localTime = timeNow.getTime()/1000; and calculates the time difference between that and the server time. It then corrects the value of the timeNow object. That object is then used as, e.g., var hours = timeNow.getHours(); var minutes = timeNow.getMinutes(); and also, in the message below, as timeNow.toLocaleTimeString(). This message is set via document.getElementById('timeMessage').innerHTML = ....

This web page will attempt to obtain an accurate time setting from the web server. If this message alters, it has been successful. Your computer's local clock may well be wrong.

The problem is that, on my phone, the timeNow object is not being correctly interpreted. Viz...

*

*

*

*

*

Ha! OK, it seems to be a bug in my phone's browser. JS is applying the Daylight Saving time offset in the wrong direction!




This page, http://site2.caves.org.uk/clock/debug_ time_setting.html was last modified on Mon, 29 Aug 2016 15:48:56 +0000
(Running on britiac3 at 31.25.186.126)