JavaScript NTP time

后端 未结 3 1849
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 01:50

I\'m writing a counting script who counts the time between an old date and today.
Everything worked good until I tested on a computer with wrong date and saw the resul

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 02:22

    I'm not sure you understand what NTP is for: Namely sychronization of the internal clock in the computer, not as use for a clock in itself.

    I would suggest, that you connect to the NTP service once to get the difference to the internal time of the client and use that to correct it for display. But I'm not exactly sure, why a comparison to the client computer time is not sufficient.

提交回复
热议问题