从 Http Servlet 请求标头读取浏览器/客户端时间
当向 servlet 发出请求时是否可以读取浏览器(客户端计算机)时间?
Is it possible to read the Browser(Client machine) time when a request is made to the servlet?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不相信是这样。 不幸的是,HTTP Date 标头仅针对 PUT 或POST 消息,即使如此,它也是可选的:
如果您可以控制客户端,您(或许)可以将其编码为单独的实验性 HTTP 标头。 或者将其添加为 GET 参数等。
I don't believe so. Unfortunately the HTTP Date header is only sent for PUT or POST messages, and even then it's optional:
If you have control of the client, you could (perhaps) encode it as a separate experimental HTTP header. Or add it as a GET parameter etc.
您可以使用 javascript 并将时间附加到每个请求。 如果启用了 javascript,您可以将以下内容添加到您的链接中:
如果您需要时区信息,您可以执行类似的操作。 这个问题可能会有所帮助。
You can use javascript and append the time to every request. Provided that javascript is enabled, you can add the following to your links:
You can do something similar, if you need timezone information. This question may help.