This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Request Object  RSS feed

 
Pradeep Chandrasekharan Nair
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!