Using Meteor, what would be an efficient way to keep a running clock (h:m:s) on the client that displays the server’s time?
The JavaScript/PHP answers I’ve found typically involve getting the server time periodically and calculating the difference between that and the client.
What would that look like with Meteor?
UPDATE: A lot has changed since I originally posted this question. If you’re interested in a pre-built solution, I recommend taking a look at Meteor Timesync by @mizzao. Install it by running meteor add mizzao:timesync in your console.
David Greenspan gets the client time in this presentation on Spark around 14:30. I’ve modified this code slightly to get server side time:
Javascript:
And the HTML: