java中如何将2021-04-05T13:08:22+08:00转成date呢

java中如何将2021-04-05T13:08:22+08:00转成date呢
 public static Date dealDateFormat(String oldDateStr) {
     
        DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
        try {
     
            Date  date = df.parse(oldDateStr);
            return date;
        } catch (ParseException e) {
     
            e.printStackTrace();
        }
        return null;
    }
dealDateFormat("2021-04-05T13:08:22+08:00");

你可能感兴趣的:(时间转换,java)