怎么将string字符串转换为Date类型

如何将string字符串转换为Date类型Reportreport new Report()SimpleDateFormat sdf newSimpleDateForm

如何将string字符串转换为Date类型
Report  report =  new Report();
SimpleDateFormat sdf = new  SimpleDateFormat();
String formatPattern = "yyyy-MM-dd" ;
sdf.applyPattern(formatPattern);
    Date reportTimeDate = sdf.parse(xmlDate);
report.setReportAddTime(reportTimeDate);