-1

I'm looking for some way to have everyone who enters my webpage syncronized, and I'm hoping to avoid having to set up my own NTP time server.

I've tried multiple solutions, but ultimately they all rely on the same thing - the date on a header, which only has an accuracy of seconds.

Date.now() is not good enough for me - and I'm hoping there's a way to do better (my laptop and my phone turn out to differ by nearly 2 seconds).

(I'm aware it's not going to be perfect and there will always be variations, but I'd like to try and do better than nearly 2 seconds).

While this is just for a side-project and not anything serious, I am hoping to amuse more than 1,000 people in one day, and so google timezone, which only offers 1,000 free calls per free API key, isn't good enough. (I can't think of any funny twist on "beggars can't be choosers")

user1999728
  • 913
  • 1
  • 8
  • 25
  • Does this answer your question? [Synchronizing time between clients in Javascript without your own backend](https://stackoverflow.com/questions/68229927/synchronizing-time-between-clients-in-javascript-without-your-own-backend) – SuperDJ Jul 03 '21 at 17:38
  • @SuperDJ no, I've already addressed the only thing resembling an answer in that question. – user1999728 Jul 03 '21 at 17:39
  • If the first time your question wasn't answered the changes of getting a answer on a second aren't bigger. It could however mean that your question is unclear or that you should add a code snippet of what you tried to clarify what – SuperDJ Jul 03 '21 at 17:39
  • @SuperDJ The question was closed for being too broad. If this question is too broad as well, I really don't understand what the problem is and what is so broad about it. – user1999728 Jul 03 '21 at 17:40

1 Answers1

0

you can use moment.js,

for static website: <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js"></script> npm (for nodejs apps): npm i moment

here's a link to their docs: enter link description here