| Author |
getting the timezone from the request
|
Renato Losio
Ranch Hand
Joined: Nov 23, 2005
Posts: 99
|
|
hello. is there any way to retrieve the user / browser timezone from the HTTP headers in the request? cheers renato
|
Renato Losio - www.arsenio.it - renatoweb@arsenio.it
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
|
|
|
Have you inspected the headers?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Renato Losio
Ranch Hand
Joined: Nov 23, 2005
Posts: 99
|
|
Well, I tried, but I could not find anything useful (or may be I am not looking for the correct info): Is there any way to have the info from the request.getLocale()? I didn't think so but may be I'm worng... cheers renato
|
 |
Sunil Vasudevan
Ranch Hand
Joined: Mar 05, 2007
Posts: 107
|
|
The method request.getLocale() will give you a Locale object. Using this object, you can call getter methods to get the language, country etc. But this will not give you a timezone (At least from my knowledge). A workaround would be to use JavaScript. In your JSP, have a hidden form variable which will be set to the the timezone from the client system. A sample javascript code that would get you the timezone offset is shown below: The hidden form value can be retrieved from your request object and you can do the necessary processing. [ March 14, 2007: Message edited by: Sunil Vasudevan ]
|
Sunil.V<br />SCJP2, SCWCD1.4, SCBCD1.3
|
 |
 |
|
|
subject: getting the timezone from the request
|
|
|