public class NtpClient extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static double |
SECONDS_1900_TO_EPOCH
difference between the unix epoch and jan 1 1900 (NTP uses that)
|
| Constructor and Description |
|---|
NtpClient() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static long[] |
currentTimeAndStratum(String[] serverNames,
int perServerTimeout,
boolean preferIPv6,
Log log)
Query the ntp servers, returning the current time from first one we find
Hack to return time and stratum
|
static void |
main(String[] args)
Main entry point for the NtpClient program.
|
static final double SECONDS_1900_TO_EPOCH
static long[] currentTimeAndStratum(String[] serverNames, int perServerTimeout, boolean preferIPv6, Log log)
log - may be nullIllegalArgumentException - if none of the servers are reachablepublic static void main(String[] args) throws IOException
args - command-line arguments; optionally "-6" followed by list of NTP serversIOException - if a network error occurs