public final class Timebase extends Object
| Modifier and Type | Method and Description |
|---|---|
static long |
convertFromNTP(long timestamp)
Converts the supplied NTP timestamp to the time in milliseconds since the
January 1st 1970 at 00:00:00 GMT epoch.
|
static long |
convertToNTP(long timemillis)
Converts the supplied time in milliseconds since the January 1st 1970 at 00:00:00 GMT
epoch to the NTP timestamp format.
|
static long |
currentTimeMillis()
Returns the current time in milliseconds since the January 1st 1970 at 00:00:00 GMT epoch.
|
static long |
currentTimeOffset()
Returns the current time offset between the uptime and the RTC in milliseconds.
|
static long |
currentTimeRTC()
Returns the current time in milliseconds since the January 1st 1970 at 00:00:00 GMT epoch.
|
static String |
getDSTTimeZone(String tz)
Returns the String representation of the abbreviation for DST in the time zone or
null if there is no abbreviation.
|
static String |
getTimeZone()
Returns the current time zone.
|
static boolean |
isDST(long time,
String tz)
Returns the TRUE if the provided time is DST for the given time zone.
|
static void |
setCurrentTime(long millis)
Sets the current time in milliseconds since the January 1st 1970 at 00:00:00 GMT epoch.
|
static long |
uptimeMicros()
Gets the number of microseconds since system boot.
|
static long |
uptimeMillis()
Gets the number of milliseconds since system boot.
|
public static long uptimeMillis()
public static long uptimeMicros()
public static String getTimeZone()
public static long currentTimeMillis()
public static long currentTimeRTC()
currentTimeMillis(). It is much faster.public static void setCurrentTime(long millis)
public static long currentTimeOffset()
public static boolean isDST(long time,
String tz)
time - specific time to checktz - time zonepublic static String getDSTTimeZone(String tz)
tz - time zonepublic static long convertFromNTP(long timestamp)
public static long convertToNTP(long timemillis)