Calendar toCalendar(String value,String pattern,Locale locale){
  Calendar calendar=null;
  try {
    DateFormat format=(locale == null) ? new SimpleDateFormat(pattern) : new SimpleDateFormat(pattern,locale);
    format.setLenient(false);
    format.parse(value);
    calendar=format.getCalendar();
  }
 catch (  Exception e) {
    fail("Error creating Calendar value ='" + value + ", pattern='"+ pattern+ "' "+ e.toString());
  }
  return calendar;
}

Calendar toCalendar ( String value , String pattern , Locale locale ) { Calendar calendar = null ; try { DateFormat format = ( locale == null ) ? new SimpleDateFormat ( pattern ) : new SimpleDateFormat ( pattern , locale ) ; format . setLenient ( false ) ; format . parse ( value ) ; calendar = format . getCalendar ( ) ; } catch ( Exception e ) { fail ( "Error creating Calendar value ='" + value + ", pattern='" + pattern + "' " + e . toString ( ) ) ; } return calendar ; }
parse a string value to a calendar
