question: public static Calendar stringToCalendar ( String s ) { Date date = null ; try { date = TIME_FORMAT . parse ( s ) ; } catch ( ParseException e ) { try { date = DATE_FORMAT . parse ( s ) ; } catch ( ParseException e1 ) { return null ; } } if ( date == null ) { return null ; } Calendar output = Calendar . getInstance ( ) ; output . setTime ( date ) ; return output ; }
target:  Convert a string date/time into the according calendar. The format used is the formats defined as constants above.