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 contain
pay attention .... timeInfo.getReturnTime() does not return the current time from the timeserver. it returns the local time when the request to the server was made.
after calling timeInfo.computeDetails() it's possible to get the offset by timeInfo.getOffset(). this returns the offset of the local time in millisecond.
to calculate the current time you could do something like:
...
long systemtime = System.currentTimeMillis();
Date realdate = new Date(systemtime + timeInfo.getOffset());
...