question: 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 ; }
target:  Parse a String value to a Calendar