public class NtpClient extends Object
Modifier and Type | Field | Description |
---|---|---|
(package private) static double |
SECONDS_1900_TO_EPOCH |
difference between the unix epoch and jan 1 1900 (NTP uses that)
|
Constructor | Description |
---|---|
NtpClient() |
Modifier and Type | Method | 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) |
Usage: NtpClient [-6] [servers...]
default pool.ntp.org
|
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
IOException