top button
Flag Notify
Site Registration

How to read "time" from a Tomcat server?

+4 votes
419 views

Is there a command i can issue to get the exact system time that the remote Tomcat server is using? And then is there a command or some way (with applicable admin rights) to set the remote time?

The idea is the sync'ing of the different PC's I am hoping to use, if there is some other way used I am grateful to hear it. I am setting up a distributed system that's running in Linux.

posted Jan 8, 2014 by Deepti Singh

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+1 vote

Check the web for the "ntpd" daemon and/or the "ntpdate" commands. You may also need "hwclock".

As for getting/setting the time remotely, you need some access to the server for that. If you have command-line access, "date" is your friend. If not, create a Tomcat webapp using any of the multiple date/time java classes to achieve this.

answer Jan 8, 2014 by Anderson
+1 vote

Depending on how you look at it - use the HTTP spec and look at the Date response header

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.18

The above technique doesn't require shell access and is an "easy" way to get the date of ANY webserver. (read the spec for caveats)

answer Jan 8, 2014 by Ahmed Patel
Similar Questions
+1 vote

For a long time I have been doing:

/etc/locale.conf change: LANG="en_US.UTF-8"
LANG="en_GB.UTF-8"

To make Thunderbird list messages with 24 hour time. Can someone suggest a better way to accomplish this?

+1 vote

I would like to sync my CentOS 6.3 hardware clock time to my NTP server's time. Can I do that without reboot the hosts?

Does anyone has the steps to do that?

+3 votes

How to set up timing if NTP was block by ISP? I have try many way such as link the timezone , getting from the hardware clock. However, it is not the solution.

Please advice.

...