常用时间用法 String format = "YYYY-MM-dd hh:mm:ss"; String format = "YYYY-MM-dd"; String now = LocalDateTime.now().format(DateTimeFormatter.ofPattern(format)); System.out.println(now);