private Instant convertTimestamp(long timestamp) throws FormatParseException {
  if (timestamp == 0) {
    return Instant.ofEpochSecond(timestamp);
  }
  int digits=(int)(Math.log10(timestamp) + 1);
  if (digits != 10 && digits != 13) {
    throw new FormatParseException("Expected a timestamp length of 10 or 13, found " + digits + " ('"+ timestamp+ "')");
  }
  boolean secondResolution=digits == 10;
  return secondResolution ? Instant.ofEpochSecond(timestamp) : Instant.ofEpochMilli(timestamp);
}

private Instant convertTimestamp ( long timestamp ) throws FormatParseException { if ( timestamp == 0 ) { return Instant . ofEpochSecond ( timestamp ) ; } int digits = ( int ) ( Math . log10 ( timestamp ) + 1 ) ; if ( digits != 10 && digits != 13 ) { throw new FormatParseException ( "Expected a timestamp length of 10 or 13, found " + digits + " ('" + timestamp + "')" ) ; } boolean secondResolution = digits == 10 ; return secondResolution ? Instant . ofEpochSecond ( timestamp ) : Instant . ofEpochMilli ( timestamp ) ; }
converts the timestamp to an instant . < p > supports 10 digit timestamps ( second resolution ) and 13 digit timestamps ( millisecond resolution ) .
