This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Request Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Request Object" Watch "Request Object" New topic

Request Object

Pradeep Chandrasekharan Nair
Ranch Hand

Joined: Apr 01, 2004
Posts: 48
i am working on a project where in i have to display date according to the client machines date format. is there any way where i can get client machines date format in my servlet through request object. Thanks in advance.
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

The best way it to ask the client which locale they are in (or want to use). There are ways to get locale info from the client though the request, but none are as reliable as just plain asking.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Here is a typical set of headers from a request and a response.
As you can see, the server sends it's date/time in a header but the browser doesn't send that information.

You will probably need to do this with Javascript.

[this time Paul beat me... ]
[ June 21, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
wood burning stoves
subject: Request Object
Similar Threads
Java Date formatting problem
Date validation in JAVA
JSP abd Date Object
java.text.ParseException in Web service
SOAP and WebServices is a fad?