将String类型转换成java.sql.Date类型
?
String str="1989-11-23 12:25:20";
java.sql.Date date=java.sql.Date.valueof(str);
?
// String转Date (转化时得抛出异常)
private String bDate = "2009-04-02 08:30";?
private String eDate = "2009-02-02 07:30";
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
Date bdate = formatter.parse(bDate);?
Date edate = formatter.parse(eDate);
//Date转String
Date date=new Date();?
String str=format.format(date);