日期转字符串
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date dates = new Date();
String strTime = sdf.format(dates);
EditText editDate = findViewById(R.id.editText6);
editDate.setText(strTime);
字符串转日期
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date date = sdf.parse( " 2010-07-10 19:20:00 " );