Java 格式化时间
方法一:SimpleDateFormat
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
方法二:LocalDate.now()
String s = LocalDate.now().toString();
注:LocalDate.now()格式为:java.time.LocalDate
String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
String s = LocalDate.now().toString();
注:LocalDate.now()格式为:java.time.LocalDate