List of usage examples for org.apache.commons.net TimeUDPClient getTime
public long getTime(InetAddress host) throws IOException
getTime(host, DEFAULT_PORT);
From source file:ProtocolRunner.java
private static void handleUDPTime( TimeUDPClient client, ProtocolRunner runner) throws IOException { //from w ww .j av a 2 s . c o m long origTime = client.getTime(InetAddress.getByName( runner.getUDPRemoteServer())); runner.getUDPServerResponse().append( "Time returned from server: " + origTime + "\r\n" + "Converted to Date: " + new Date(((origTime) - TimeUDPClient.SECONDS_1900_TO_1970)*1000L)); }