net.i2p.time
public class NtpClient extends Object
Constructor and Description |
---|
NtpClient() |
Modifier and Type | Method and Description |
---|---|
static long |
currentTime(String serverName)
Query the given NTP server, returning the current internet time
|
static long |
currentTime(String[] serverNames)
Query the ntp servers, returning the current time from first one we find
|
static long[] |
currentTimeAndStratum(String[] serverNames)
Query the ntp servers, returning the current time from first one we find
Hack to return time and stratum
|
static void |
main(String[] args) |
(package private) static void |
printUsage()
Prints usage
|
public static long currentTime(String[] serverNames)
IllegalArgumentException
- if none of the servers are reachablepublic static long[] currentTimeAndStratum(String[] serverNames)
IllegalArgumentException
- if none of the servers are reachablepublic static long currentTime(String serverName)
public static void main(String[] args) throws IOException
IOException
static void printUsage()