public static Date parseDate ( final String input ) { try { return df . get ( ) . parse ( input ) ; } catch ( final ParseException e ) { try { // FIXME: Workaround to make the tests run with non-English locales return new SimpleDateFormat ( DATE_FORMAT_MASK , Locale . UK ) . parse ( input ) ; } catch ( ParseException e1 ) { throw new IllegalArgumentException ( "Invalid date input format: [" + input + "] it should follow: [" + DATE_FORMAT_MASK + "]" ) ; } } }
Use the simple date formatter to read the date from a string