public int compareTo(TimestampWritable t) {
    checkBytes();
    long s1 = this.getSeconds();
    long s2 = t.getSeconds();
    if (s1 == s2) {
      int n1 = this.getNanos();
      int n2 = t.getNanos();
      if (n1 == n2) {
        return 0;
      }
      return n1 - n2;
    } else {
      return s1 < s2 ? -1 : 1;
    }
  }
@return double representation of the timestamp, accurate to nanoseconds
serde/src/java/org/apache/hadoop/hive/serde2/io/TimestampWritable.java