This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Servlets and the fly likes Browser zone Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Browser zone" Watch "Browser zone" New topic
Author

Browser zone

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Helo!
Is there any way to ask what timezone the client (=browser) is?
------------------
Antti Barck
It Solutions Consultant -- NSD Oy
Sun Certified Programmer for the Java� 2 Platform
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
Hi,
you could use the JavaScript Date object (see http://developer.netscape.com/docs/manuals/js/client/jsref/date.htm)
You would most likely need to parse the results of the toString() method to find the timezone, and check the results on different browsers, for example when I tried the following code in IE, my time zone was PDT, and in Netscape it was "Pacific Daylight Time".

Hope this helps,
James.
[This message has been edited by james swan (edited August 27, 2001).]
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Helo Jim!
Of course JavaScript runs on client side, thx How did I not figure that out myself, instead I was hunting some other parts of the request. This is good thing but need some thinking for incorporation. Thx again
------------------
Antti Barck
It Solutions Consultant -- NSD Oy
Sun Certified Programmer for the Java� 2 Platform
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Browser zone