Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting my desktop's time ?

 
Tom Barns
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I'm trying to get the time from my machine(desktop) from my jsp page.because i think when i use System.currentTimeMillis()
I get the time of my server(Tomcat).
I need to get the time from my machine and not the time of my server.I'm using that to test time performance.
or if System.currentTimeMillis() gets the time of my desktop,how do i get the time of my server.
thanks for help.
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm no expert, but I'll give it a try. Someone please correct if I'm wrong.
I don't think it is possible to get the client's time from a server application. There no code running on the client. If I had to do this, I would probably use the JavaScript Date object. That would execute on the client side, then you could retrieve the value.
 
Tom Barns
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply.
How about we get the client time using javascript and passing it
to the server application.
because what i need to do is to count the processing time of the server from the point that is you send the request to the point that is you get the response.
please advice.
thanks.
 
sandy gupta
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do u know that the client machine is synchronized to the server time. It might be having a wrong time or might be in a diff time zone all together( if its a web app ).
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sandy is right, you could try synchronizing them (comparing the two times), but even then you have to worry about network (dial-up?) speed.
 
Tom Barns
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thansk for your time.
I'm testing that response on my machine that has tomcat on it.
that means we have 100% synchronization.
in will try to think how i will do that with other server.
maybe i will get back to ask.
Thanks again.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic