|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.epics.pvmanager.util.TimeStamp
Timestamp
@Deprecated public class TimeStamp
Represent a time stamp at nanosecond accuracy. The time is internally stored as two values: the UNIX timestamp (number of seconds since 1/1/1970) and the nanoseconds past that timestamp. The UNIX timestamp is stored as a signed long, which has the range of 292 billion years before and another 292 past the epoch.
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.
Method Summary | |
---|---|
java.util.Date |
asDate()
Deprecated. Converts the time stamp to a standard Date. |
Timestamp |
asTimestamp()
Deprecated. Converts to the epics common definition of time. |
static 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(java.lang.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(java.util.Date date)
Deprecated. Converts a Date to a timestamp. |
static TimeStamp |
timestampOf(Timestamp timestamp)
Deprecated. |
java.lang.String |
toString()
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
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(java.util.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 convert
public static TimeStamp timestampOf(Timestamp timestamp)
public static TimeStamp now()
System.nanoTime()
, so it has the accuracy given
by that function.
public java.util.Date asDate()
public Timestamp asTimestamp()
public static Timestamp asTimestamp(TimeStamp timeStamp)
timeStamp
- the timeStamp to convert
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(TimeStamp other)
compareTo
in interface java.lang.Comparable<TimeStamp>
other
- another object
public TimeStamp plus(TimeDuration duration)
duration
- a time duration
public TimeStamp minus(TimeDuration duration)
duration
- a time duration
public java.lang.String toString()
toString
in class java.lang.Object
public TimeDuration durationFrom(TimeStamp reference)
reference
- another time stamp
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |