public static Date parseLocalDate(String text,String fieldName){
  try {
    return YYYYMMDD_UTC_FORMAT.parse(text);
  }
 catch (  ParseException e) {
    throw new InvalidObjectDataException(String.format("The %s field should be in yyyy-MM-dd format",fieldName));
  }
}

public static Date parseLocalDate ( String text , String fieldName ) { try { return YYYYMMDD_UTC_FORMAT . parse ( text ) ; } catch ( ParseException e ) { throw new InvalidObjectDataException ( String . format ( "The %s field should be in yyyy-MM-dd format" , fieldName ) ) ; } }
parses a yyyy - mm - dd date , yielding a date object at utc midnight on the given date .
