code: private static String convertDateElementToString(Date currentDate, SimpleDateFormat dateFormat) {
          return currentDate.getTime() != 0 ? dateFormat.format(currentDate.getTime()) : "";
      }
docs: The function to convert a date into a string according to the format used.
  
  @param currentDate the date to convert.
  @param dateFormat  the formatter to convert date element into string.
  @return the string that corresponds to the date in the format used.