LocalDateTime转换为固定格式的string
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); String nowTime = LocalDateTime.now().format(formatter); System.out.println("nowTime:"+ nowTime);
LocalDateTime转换为固定格式的string
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); String nowTime = LocalDateTime.now().format(formatter); System.out.println("nowTime:"+ nowTime);