String转Date
String date="";
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
Date d=format.parse(date);
Date转String
Date d=new Date();
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
String date=sdf.format(d);
来源:https://www.cnblogs.com/xiangtunmizu/p/11904238.html