String转换成Date类型 SimpleDateFormat format= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = format.parse("2019-09-19") Date转换成String类型 SimpleDateFormat format= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String time = format.format(new Date());