SimpleDatetimeFormat 线程不安全是因为这个format持有一个对象,这个对象会被多个线程修改 DateTimeFormatter 线程安全是因为是一个immutable , 不变的量在不同线程是不会有线程安全问题 相关阅读 https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html https://stackoverflow.com/questions/22739851/format-datetime-with-time-simpledatetimeformat-calendar-gregoriancalendar