Package ucar.unidata.util
Class Timestamp
java.lang.Object
ucar.unidata.util.Timestamp
- All Implemented Interfaces:
Serializable
,Comparable
A immutable timestamp and related utilities.
Hopefully lighter weight than java.util.Date (which is mutable),
and we don't have to trip over javasoft/Taligent deprecations.
We are using the java "long millisecs since the epoch" as internal representation. This doesn't roll over until August of 292,278,994.
- Version:
- $Revision: 1.13 $ $Date: 2006/05/05 19:19:38 $
- Author:
- $Author: jeffmc $
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a Timestamp and initialized to the current time.Timestamp
(int secsPrior) Construct a Timestamp initialized by current time minus given seconds.Timestamp
(long millis) Construct a Timestamp and initialized to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.Construct a Timestamp and initialized by a Date object. -
Method Summary
-
Field Details
-
NONE
_more_ -
millis_
protected final long millis__more_
-
-
Constructor Details
-
Timestamp
public Timestamp(long millis) Construct a Timestamp and initialized to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.- Parameters:
millis
- long milliseconds since January 1, 1970, 00:00:00 GMT- See Also:
-
Timestamp
public Timestamp()Construct a Timestamp and initialized to the current time.- See Also:
-
Timestamp
Construct a Timestamp and initialized by a Date object.- Parameters:
date
-- See Also:
-
Timestamp
public Timestamp(int secsPrior) Construct a Timestamp initialized by current time minus given seconds.- Parameters:
secsPrior
- number oif seconds prior to current time
-
-
Method Details
-
getMillis
public long getMillis()- Returns:
- long time value represented by this, in number of milliseconds since January 1, 1970, 00:00:00 GMT
-
format
_more_- Parameters:
buf
-- Returns:
- _more_
-
hashCode
public int hashCode()_more_ -
equals
_more_ -
toString
_more_ -
compareTo
_more_- Parameters:
ts
-- Returns:
- _more_
-
compareTo
_more_- Specified by:
compareTo
in interfaceComparable
- Parameters:
oo
-- Returns:
- _more_
-
main
_more_- Parameters:
args
-
-