code: public synchronized static String formatAgmipDateString(String agmipDate, String format) {
          try {
              SimpleDateFormat fmt = new SimpleDateFormat(format);
              Date d = dateFormatter.parse(agmipDate);
              return fmt.format(d);
          } catch (Exception ex) {
              return null;
          }
      }
docs: Convert from AgMIP standard date string (YYMMDD) to a custom date string
  
  @param agmipDate AgMIP standard date string
  @param format Destination format
  
  @return a formatted date string or {@code null}