code: public static String getDateFormat(final Date date, final String pattern) {
  
      SimpleDateFormat simpleDateFormat = buildDateFormat(pattern);
      return simpleDateFormat.format(date);
    }
docs: Format date by given pattern.
  
  @param date date to be handled.
  @param pattern pattern use to handle given date.
  @return a string object of format date by given pattern.