List of usage examples for org.apache.commons.net.daytime DaytimeUDPClient getTime
public String getTime(InetAddress host) throws IOException
getTime(host, DaytimeUDPClient.DEFAULT_PORT);
From source file:examples.daytime.java
public static final void daytimeUDP(String host) throws IOException { DaytimeUDPClient client = new DaytimeUDPClient(); // We want to timeout if a response takes longer than 60 seconds client.setDefaultTimeout(60000);/* w w w.ja v a2 s.c o m*/ client.open(); System.out.println(client.getTime(InetAddress.getByName(host)).trim()); client.close(); }