Timestamp
@Deprecated public class TimeStamp extends Object implements Comparable<TimeStamp>
Note that while TimeStamp are usually created according to system clocks which takes into account leap seconds, all the math operations on TimeStamps do not take leap seconds into account.
Modifier and Type | Method and Description |
---|---|
Date |
asDate()
Deprecated.
Converts the time stamp to a standard Date.
|
org.epics.util.time.Timestamp |
asTimestamp()
Deprecated.
Converts to the epics common definition of time.
|
static org.epics.util.time.Timestamp |
asTimestamp(TimeStamp timeStamp)
Deprecated.
Null safe way of converting to the epics common definition of time.
|
int |
compareTo(TimeStamp other)
Deprecated.
Defines the natural ordering for timestamp as forward in time.
|
TimeDuration |
durationFrom(TimeStamp reference)
Deprecated.
Calculates the time passed from the reference to this timeStamp.
|
boolean |
equals(Object obj)
Deprecated.
|
long |
getNanoSec()
Deprecated.
Nanoseconds within the given second.
|
long |
getSec()
Deprecated.
Unix time; seconds from midnight 1/1/1970.
|
int |
hashCode()
Deprecated.
|
TimeStamp |
minus(TimeDuration duration)
Deprecated.
Subtracts the given duration to this timestamp and returns the result.
|
static TimeStamp |
now()
Deprecated.
Returns a new timestamp for the current instant.
|
TimeStamp |
plus(TimeDuration duration)
Deprecated.
Adds the given duration to this timestamp and returns the result.
|
static TimeStamp |
time(long unixSec,
int nanoSec)
Deprecated.
Returns a new timestamp from UNIX time.
|
static TimeStamp |
timestampOf(Date date)
Deprecated.
Converts a
Date to a timestamp. |
static TimeStamp |
timestampOf(org.epics.util.time.Timestamp timestamp)
Deprecated.
|
String |
toString()
Deprecated.
|
public long getSec()
public long getNanoSec()
public static TimeStamp time(long unixSec, int nanoSec)
unixSec
- number of seconds in the UNIX epoch.nanoSec
- nanoseconds past the given seconds (must be 0 < nanoSec < 999,999,999)public static TimeStamp timestampOf(Date date)
Date
to a timestamp. Date is accurate to
milliseconds, so the last 6 digits are always going to be zeros.date
- the date to convertpublic static TimeStamp timestampOf(org.epics.util.time.Timestamp timestamp)
public static TimeStamp now()
System.nanoTime()
, so it has the accuracy given
by that function.public Date asDate()
public org.epics.util.time.Timestamp asTimestamp()
public static org.epics.util.time.Timestamp asTimestamp(TimeStamp timeStamp)
timeStamp
- the timeStamp to convertpublic int compareTo(TimeStamp other)
compareTo
in interface Comparable<TimeStamp>
other
- another objectpublic TimeStamp plus(TimeDuration duration)
duration
- a time durationpublic TimeStamp minus(TimeDuration duration)
duration
- a time durationpublic TimeDuration durationFrom(TimeStamp reference)
reference
- another time stampCopyright © 2012. All Rights Reserved.