This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes capturing timezone from a browser??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Java in General
Bookmark "capturing timezone from a browser???" Watch "capturing timezone from a browser???" New topic

capturing timezone from a browser???

deep venu
Ranch Hand

Joined: Jun 09, 2001
Posts: 56
In my Web-based application i need to capture the user's local time/ timezone so that i can have the GMT - offset and there by have an appropriate entry in the database.
Any pointers please???
thank U
Mike Titus

Joined: Sep 16, 2001
Posts: 2
Use JavaScript to get the current date and time in the client's browser, and send that value back to the server using a GET or POST. This isn't complete, but it will give you the idea:
<BODY onLoad="form.currentDate = new Date()">
<FORM NAME="form" METHOD="post">
<INPUT NAME="currentDate" TYPE="hidden">

[This message has been edited by Mike Titus (edited October 01, 2001).]
deep venu
Ranch Hand

Joined: Jun 09, 2001
Posts: 56
thanx buddy lemme try it out and get back to u..:-)
Have you checked out Aspose?
subject: capturing timezone from a browser???
It's not a secret anymore!