1.以上两个类用来格式化日期用的。
2.DateTimeFormatter是线程安全的。而SimpleDateFormat是线程不安全的。
example
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
dateTimeFormatter.format(LocalDateTime.now());
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
simpleDateFormat.format(new Date());