public static Timestamp longToTimestamp(long time, boolean intToTimestampInSeconds) {
    // If the time is in seconds, converts it to milliseconds first.
    if (intToTimestampInSeconds) {
      return Timestamp.ofEpochSecond(time);
    }
    return Timestamp.ofEpochMilli(time);
  }
Converts the time in seconds or milliseconds to a timestamp.
@param time time in seconds or in milliseconds
@return the timestamp
serde/src/java/org/apache/hadoop/hive/serde2/io/TimestampWritableV2.java