public static Calendar toCalendar(String datestring,String format){
  Date d=parse(datestring,format);
  Calendar cal=Calendar.getInstance();
  cal.setTimeInMillis(d.getTime());
  return cal;
}

public static Calendar toCalendar ( String datestring , String format ) { Date d = parse ( datestring , format ) ; Calendar cal = Calendar . getInstance ( ) ; cal . setTimeInMillis ( d . getTime ( ) ) ; return cal ; }
returns a calendar from a given string using the provided format .
