code: public static String dateStringFromLocalDate(LocalDate date) {
          try {
              return date.toString(DATE_PATTERN);
          } catch (Exception e) {
              return null;
          }
      }
docs: Format a @see org.joda.time.LocalDate.
  
  @param date date to format
  @return formatted date in YYYY-MM-DD