📅  最后修改于: 2022-03-11 14:52:15.498000             🧑  作者: Mango
DateTimeFormatter oldPattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
DateTimeFormatter newPattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
LocalDateTime datetime = LocalDateTime.parse(input, oldPattern);
String output = datetime.format(newPattern);