public static long getSeconds(byte[] bytes, int offset) {
    int firstVInt = bytesToInt(bytes, offset);
    if (firstVInt >= 0 || !hasSecondVInt(bytes[offset + 4])) {
      return firstVInt & ~DECIMAL_OR_SECOND_VINT_FLAG;
    }
    return ((long) (firstVInt & ~DECIMAL_OR_SECOND_VINT_FLAG)) |
        (LazyBinaryUtils.readVLongFromByteArray(bytes,
            offset + 4 + WritableUtils.decodeVIntSize(bytes[offset + 4])) << 31);
  }
Given an integer representing nanoseconds, write its serialized
value to the byte array b at offset

@param nanos
@param b
@param offset
@return
serde/src/java/org/apache/hadoop/hive/serde2/io/TimestampLocalTZWritable.java