阅读背景:

同步客户端javascript时钟与服务器日期的最佳方式

来源:互联网 

I have a task to show digital clock (with minutes precision) on HTML page in some fixed timezone (MSK or MSD - depending on current date). I'd like to avoid relying on client system clock, so some synchronization with server is required. HTTP server sends Date header in each response so we can send an AJAX GET or HEAD request to any URL of our site to get server date, calculate the difference with client date and use it when updating clock with setTimeout(). There are other issues remains: timezone switching for daylight settings, latency accounting for very slow connections.I have a task to show digital clock (with minut




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: