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 ( ) ; } }
Return rfc or iso String datetime as java Date