在客户端和 Java 后端之间共享 UTC 时间
我想使用 JavaScript 将数据字符串转换为时间戳(其中包括请求客户端的 UTC 偏移量),以便发送到我的服务器端代码,然后在服务器上重建它。谁能推荐一种具有良好 Java 支持的好格式?
我希望能够在服务器上解析这个字符串,而不必知道正在解析哪个时区。这个可以吗,有没有人有好的解决办法?
I want to convert a data string into a timestamp (which would include the UTC offset of the requesting client) using JavaScript for sending to my server side code and then rebuild it on the server. Can anyone recommend a good format to use which has good Java support?
I want to be able parse this string on the server without having to know what timezone im parsing. Is this possible, does anyone have any good solutions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需以 utc 格式的长值传递时间,您就可以在 javascript 中将其解析为浏览器时区
Just pass time in long value that is always in utc and you can parse it in javascript as browser timezone