我一直在阅读文档,似乎找不到从服务器而不是客户端设置日期的方法?
例如像这样的东西
moment().set('server time')
Run Code Online (Sandbox Code Playgroud)
然后,moment()将根据服务器的时间返回Date对象,而不是来自客户端计算机的时间.
是否存在此功能,如果不存在,您将使用哪些推荐方法?现在我正在轮询服务器以获取服务器的时间,但是你可以想象这不是很有效.
I am building an auction application. So server time is critical. For example if the user has tampered with their time settings or their time has been manually configured, the client might see an auction that has already ended, when in fact it still has a few minutes left. All time checks are obviously done on the server, but that is why I need the client and server to be in …