import java.text.SimpleDateFormat;
import java.util.Date;
class Main{
/**
* Parse a string that contains date, return a date object
* using format "yyyy-MM-dd HH:mm:ss"
* @param dateString
* @return a date object that is parsed from dateString
*/
public static Date convertString2Date(String dateString)
{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = null;
try {
date = sdf.parse(dateString);
} catch (Exception e) {
e.printStackTrace();
}
return date;
}
}