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