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