• Post Reply Bookmark Topic Watch Topic
  • New Topic

getting system time on remote machine  RSS feed

 
Dan Murphy
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If I execute:

It will create a Date object that represents the current time on the local machine. Is there any way to get the time on a remote machine. I need to do this in order to detect whether the clocks on different machines are out of synch.

Cheers,
Dan

[ February 18, 2007: Message edited by: Dan Murphy ]
[ February 18, 2007: Message edited by: Dan Murphy ]
 
Baiju Varugese
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you need to run a simple service like RMI in a remote machine to get the time from the machine.
 
Paul Clapham
Sheriff
Posts: 22819
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a theoretical exercise (e.g. homework or something like that) or do you actually need to synchronize the time on two machines? If it's the latter you should probably use existing, tested, methods like Network Time Protocol instead of trying to design your own version using Java.
 
Dan Murphy
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't actually want to synchronize times on machines, I just want to detect when they differ by more than a certain amount, e.g. because NTP is not running.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!