Class Timestamp

java.lang.Object
ucar.unidata.util.Timestamp
All Implemented Interfaces:
Serializable, Comparable

public class Timestamp extends Object implements Comparable, Serializable
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 Details

    • NONE

      public static final Timestamp 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

      public Timestamp(Date date)
      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

      public StringBuffer format(StringBuffer buf)
      _more_
      Parameters:
      buf -
      Returns:
      _more_
    • hashCode

      public int hashCode()
      _more_
      Overrides:
      hashCode in class Object
      Returns:
      _more_
    • equals

      public boolean equals(Object oo)
      _more_
      Overrides:
      equals in class Object
      Parameters:
      oo -
      Returns:
      _more_
    • toString

      public String toString()
      _more_
      Overrides:
      toString in class Object
      Returns:
      _more_
    • compareTo

      public int compareTo(Timestamp ts)
      _more_
      Parameters:
      ts -
      Returns:
      _more_
    • compareTo

      public int compareTo(Object oo)
      _more_
      Specified by:
      compareTo in interface Comparable
      Parameters:
      oo -
      Returns:
      _more_
    • main

      public static void main(String[] args)
      _more_
      Parameters:
      args -