2

我的代码中有错误我在 yyyy-mm-dd 中编写了日期格式 在 mm 中有错误所以如何将其转换为 yyyy-MM-dd

Date currentDate = new Date (date);
    SimpleDateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd");
    return dateFormat.format(currentDate);

 DateTimeFormatter formatter = DateTimeFormat.forPattern("yyyy-mm-dd");
    return formatter.parseDateTime(date).getMillis();
  }

01 中的所有月份如何转换为正确的月份

4

0 回答 0