Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay accurate local time on web site?
    text
    copied!<p>I've been asked to display the 'correct' time on our website which I frankly feel is rather pointless as 'correct' can be interpretted in such a variety of ways.</p> <p>Our current method definately results in an inaccurate time as it uses a server control rendering JavaScript that runs onload using the datetime from the server as a parameter to create a clock object in JavaScript that finally renders on the page and then starts incrementing the clock. Between the server processing, network latency and client-side performance (there's plenty other stuff running onload) the clock ends up way off the actual server time and who knows compared to the client PC.</p> <p>So to get the 'correct' time shown I could;</p> <ul> <li>Use local PC time and pass new Date() to the JavaScript clock object. Pros: Should be as close to the PC clock as possible. Cons: Not sure how accurate the PC clock is let alone in which timezone.</li> <li>Use web service for TCP request to NTP server to update clock on web page. Pros: If local PC also sync'd to NTP will be accurate and best possible match. Cons: Will have to handle all the timezone adjustments relative to our servers. If PC clock is out will still have mismatch.</li> </ul> <p>Do I implement my own web service or use something like; <a href="http://www.earthtools.org/webservices.htm" rel="nofollow noreferrer">Earth Tools</a> or World Time Web Service (<strong>EDIT:</strong> link removed - now 404)</p> <p>Here's a blog post from <a href="http://weblogs.asp.net/jgalloway/archive/2004/04/08/110029.aspx" rel="nofollow noreferrer">Jon Galloway on Atomic Clock Web Service</a> which is pretty old and yet ranks high when I google and he doesn't reach a conclusion.</p> <p>Hoepfully I can win the argument with management why syncing to our server clock (GMT) doesn't makes sense if your not in that timezone and why we even need to match a local PC.</p> <p>Any angles on this I'm missing?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload