public class NtpUtil
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
NTP_DEFAULT_PORT
Default ntp port.
|
static java.lang.String |
NTP_DEFAULT_SERVER
Default NTP url.
|
static int |
NTP_DEFAULT_TIMEOUT
Default NTP timemout.
|
static java.lang.String |
NTP_PORT_PROPERTY
Property to set the NTP port.
|
static java.lang.String |
NTP_TIMEOUT_PROPERTY
Property to set the NTP timeout.
|
static java.lang.String |
NTP_URL_PROPERTY
Property to set the NTP URL.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
updateLocalTime()
Updates the local time.
|
static void |
updateLocalTime(java.lang.String url,
int port,
int timout)
Updates the local time.
|
public static final java.lang.String NTP_URL_PROPERTY
public static final java.lang.String NTP_PORT_PROPERTY
public static final java.lang.String NTP_TIMEOUT_PROPERTY
public static final int NTP_DEFAULT_PORT
public static final java.lang.String NTP_DEFAULT_SERVER
public static final int NTP_DEFAULT_TIMEOUT
public static void updateLocalTime()
throws java.io.IOException
java.io.IOException - if an error occurred.public static void updateLocalTime(java.lang.String url,
int port,
int timout)
throws java.io.IOException
url - the ntp server url.port - the ntp server port.timout - the timeout.java.io.IOException - if an error occurred.