A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Pradeep Chandrasekharan Nair
Joined: Apr 01, 2004
Jun 21, 2005 06:48:00
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
through request object. Thanks in advance.
Joined: Apr 14, 2004
Jun 21, 2005 06:53:00
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.
Joined: Dec 11, 2004
Jun 21, 2005 06:55:00
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.
GET /ubb/graemlins/icon_jumping.gif HTTP/1.1 Host: saloon.javaranch.com User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050328 Fedora/1.7.6-1.2.5 Accept: image/png,*/*;q=0.5 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Referer: [url=http://www.javaranch.com]http://www.javaranch.com[/url] Cookie: logi.... If-Modified-Since: Sat, 05 Jul 2003 20:18:39 GMT If-None-Match: "160c018-248-3c1bb942aa5c0" Cache-Control: max-age=0 HTTP/1.x 304 Not Modified Date: Tue, 21 Jun 2005 12:49:49 GMT Server: Apache/2.0.46 (CentOS) Connection: Keep-Alive Keep-Alive: timeout=15, max=52 Etag: "....
[this time Paul beat me...
[ June 21, 2005: Message edited by: Ben Souther ]
How to ask a question...
Simple Servlet Examples
I agree. Here's the link:
subject: Request Object
java.text.ParseException in Web service
JSP abd Date Object
Java Date formatting problem
Date validation in JAVA
SOAP and WebServices is a fad?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015