code: public static Date getYear(String string) {
  		if (string == null) {
  			return null;
  		}
  		Date date = null;
  		try {
  			date = ((SimpleDateFormat)year.clone()) .parse(string);
  		}
  		catch (ParseException ex) {
  			return null;
  		}
  		return date;
  	}
docs: Returns the year given a string in format yyyy.