Wed Sep 01 2021 00:00:00 GMT+0800 (中国标准时间)转换为java中date类型并yyyy-MM-dd格式化
#将GMT格式date字符串转换为yyyy-MM-dd格式
public String dateFormat(String dtoDate) throws ParseException {
dtoDate=dtoDate.substring(0,33);
System.out.println(dtoDate);
dtoDate = dtoDate.replace("GMT", "").replaceAll("\\(.*\\)", "");
//将字符串转化为date类型,格式2021-09-01
SimpleDateFormat format = new SimpleDateFormat("EEE MMM dd yyyy hh:mm:ss z", Locale.ENGLISH);
Date date = format.parse(dtoDate);
String format1 = new SimpleDateFormat("yyyy-MM-dd").format(date);
return format1;
}