tags:

views:

70

answers:

1

I am making a distributed java app for which I need both parts of the app to run on one standard time. Since system times can be different I was thinking if java API contains some class to download time from a standard online source?

+2  A: 

You need to use the NTP (Network Time Protocol) protocol:

http://en.wikipedia.org/wiki/Network_Time_Protocol

The following link contains some reference Java NTP Client code for interacting with an NTP server:

http://psp2.ntp.org/bin/view/Support/JavaSntpClient

Jon