I want to use the time of client machine in Web application. Is there any way to get user time from HttpServletRequest
? I can't use any javascript or client side scripting, as this web application is for lower end mobile phones, which do not support scripting. Thanks.
Asked
Active
Viewed 2,626 times
2

Ahamed
- 39,245
- 13
- 40
- 68
2 Answers
3
What you are after might not be possible, as stated in this previous SO thread:
Clients SHOULD only send a Date header field in messages that include an entity-body, as in the case of the PUT and POST requests, and even then it is optional. A client without a clock MUST NOT send a Date header field in a request.
2
If you look at the raw request made by the client you will see that in general no client timestamp is sent with the request.
This means that you have to add the time information to your request on the client side to make it available on the server side.

light_303
- 2,101
- 2
- 18
- 35