question: public static Date stringToDate ( String strdate , @ SuppressWarnings ( "SameParameterValue" ) String format ) { Date date = null ; SimpleDateFormat formatter = new SimpleDateFormat ( format ) ; try { date = formatter . parse ( strdate ) ; } catch ( ParseException e ) { e . printStackTrace ( ) ; } return date ; }
target:  Convert date in string format to Date format