code: synchronized private static Date extractFromTimestamp(String watermark) {
      final SimpleDateFormat inputFormat = new SimpleDateFormat(INPUTFORMAT);
      final SimpleDateFormat outputFormat = new SimpleDateFormat(OUTPUTFORMAT);
      Date outDate = null;
      try {
        Date date = inputFormat.parse(watermark);
        String dateStr = outputFormat.format(date);
        outDate = outputFormat.parse(dateStr);
      } catch (ParseException e) {
        LOG.error(e.getMessage(), e);
      }
      return outDate;
    }
docs: Convert timestamp to hour (yyyymmddHHmmss to yyyymmddHH)
  
  @param watermark value
  @return value in hour format