You should use java.text.SimpleDateFormat to convert String value to Date. E.g.

1 private static final SimpleDateFormat sdf = new SimpleDateFormat(”yyyy-MM-dd”);
2 String birthDate = “ 1981 - 12 - 30 ?;
3 Date birth = sdf.format(birthDate);

相关文章: