code: public static Date fromDate(final String dt) throws BadDateException {
      try {
        if (dt == null) {
          return null;
        }
  
        if (dt.indexOf("T") > 0) {
          return fromDateTime(dt);
        }
  
        if (!dt.contains("-")) {
          return fromISODate(dt);
        }
  
        return fromRfcDate(dt);
      } catch (Throwable t) {
        throw new BadDateException();
      }
    }
docs: Return rfc or iso String date or datetime as java Date
  
  @param dt string format date
  @return Date
  @throws BadDateException on format error