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;
}

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 ; }
convert date in string format to date format
