This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes how to get server time and client time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to get server time and client time " Watch "how to get server time and client time " New topic

how to get server time and client time


Joined: Mar 11, 2008
Posts: 15
Hi Friends,
I want a program to get the time of server as well as client. By only java servlet. Any help in this regard is highly appreciated. Thanks in advance.

S K B<br />SCJP 1.5 (83%)
Jigar Naik
Ranch Hand

Joined: Dec 12, 2006
Posts: 751
As long as i know there is no straight forward way of doing it.

you can send client time as a request parameter to the servlet and you can get the client time using java script.

Jigar Naik

Syed Saifuddin
Ranch Hand

Joined: Sep 01, 2003
Posts: 130

The solution for client side is javascript and over server you have java.util.Date

Thank You & Best Regards,

Syed Saifuddin,
Senior Software Engineer

SAP Oracle AIX & Java Training
It is sorta covered in the JavaRanch Style Guide.
subject: how to get server time and client time
Similar Threads
need help for tracking time?
What is Client VM?
JSP Performance
problem with fetching Date
Connection reset by peer