你是要字符串转Date吗?
try { Date parse = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("2021-01-01"); } catch (ParseException e) { e.printStackTrace(); }