code: public static DateTime getJodaOrJavaDate(final DateTimeFormatter dateFormatter, final String date) throws Exception {
          if (DateTimeUtils.isDateValid(date, dateFormatter.getLocale())) {
              DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, dateFormatter.getLocale());
  
              Calendar dateCalendar = GregorianCalendar.getInstance();
              dateCalendar.setTime(dateFormat.parse(date));
  
              return new DateTime(dateCalendar.getTime());
          }
  
          return new DateTime(date);
      }
docs: Returns a LocalDateTime depending on how the date passes as argument is formatted.
  
  @param date date passed as argument
  @return the DateTime if it could parse it