code: public static String getShortDateString(long time, String format) {
          if (format == null || format.isEmpty()) {
              format = "yyyy-MM-dd";
          }
  
          SimpleDateFormat smpf = new SimpleDateFormat(format);
          return smpf.format(new Date(time));
      }
docs: get formated date String
  
  @param time
  @param format if is null or empty, will use "yyyy-MM-dd"