public class SystemTime extends Time2
Time2 time with millisecond resolution and the
origin at 1970-01-01. It corresponds to the time used internally by
Date. For times before 1970-01-01,
TimeIndex.asOffset() will return negative values. The domain label is
systemtime.| Modifier and Type | Field and Description |
|---|---|
static TimeDomain |
DOMAIN
A constant holding the domain.
|
static String |
LABEL
A constant holding the domain label.
|
| Constructor and Description |
|---|
SystemTime()
Constructs the current time in the
systemtimedomain. |
SystemTime(long millis)
Construct a
systemtimefrom a Java fast time. |
SystemTime(long year,
int month,
int day,
int hour,
int min,
int sec,
int msec)
Construct a
systemtimetime from the given time components. |
SystemTime(String date)
Construct a
systemtimetime from a string. |
SystemTime(TimeIndex time)
Construct a
systemtimetime from another time object. |
| Modifier and Type | Method and Description |
|---|---|
long |
asFastJavaTime()
Get the fast Java time corresponding to this
systemtime. |
public static final String LABEL
public static final TimeDomain DOMAIN
public SystemTime(TimeIndex time) throws T2Exception
systemtimetime from another time object.
time - a non-null time in the domain systemtime
T2Exceptionpublic SystemTime()
throws T2Exception
systemtimedomain.
T2Exceptionpublic SystemTime(long millis)
systemtimefrom a Java fast time. A Java fast time is returned for example by
System.currentTimeMillis()To get a Java fast time from a
systemtimedo
SystemTime t; ... long javaTime = t - SystemTime.DOMAIN.getOrigin();
millis - a number of milliseconds since the epochpublic SystemTime(String date) throws T2Exception
systemtimetime from a string.
date - a non-null stringT2Exceptionpublic SystemTime(long year,
int month,
int day,
int hour,
int min,
int sec,
int msec)
throws T2Exception
systemtimetime from the given time components.
year - a non-negative numbermonth - a number in [1-12]day - a number between 1 and the last day of the monthhour - a number in [0-23]min - a number in [0-59]sec - a number in [0-59]msec - a msec in [0-999]T2ExceptionCopyright © 2017. All rights reserved.