This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Passing current date/time with request

 
Ricardo Estafan
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all,

is there a way that i can pass the current date and time with the request using javascript. I want to read out this information in the java-code (Struts application) handling the request. Does anyone know how to do this?
I want to execute this script preferably on a submit so i know exactly when the client submit a request or a post.

Thanks a lot!!
[ May 24, 2005: Message edited by: Ricardo Estafan ]
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Something like this will get the users time:

BUT you have to remeber that this time is different than the servers, why don;t you just grab the servers time when you are saving the data to the database? Now sure why you would rely of JavaScript for this which can be disabled by the user.

Eric
 
Ricardo Estafan
Ranch Hand
Posts: 84
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are exactly correct, i am not sure my self. I want to measure the performance of a java application. Client time and server time, but come to think of it preferably without changing the existing code. Perhaps i will post this question in another topic.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic