public static double getDouble(Timestamp ts) {
    long seconds = ts.toEpochSecond();
    return seconds + ((double) ts.getNanos()) / 1000000000;
  }
Convert the timestamp to a double measured in seconds.
@return double representation of the timestamp, accurate to nanoseconds
common/src/java/org/apache/hadoop/hive/common/type/TimestampUtils.java