Date和String类型互相转化:
SimpleDateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date currentTime=dateformat.parse("2020-4-12 14:15:00");
System.out.println(currentTime);
String dateStr = dateformat.format(currentTime);
System.out.println(dateStr);