1DateTimeFormatter oldPattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
2DateTimeFormatter newPattern = DateTimeFormatter.ofPattern("yyyy-MM-dd");
3
4LocalDateTime datetime = LocalDateTime.parse(input, oldPattern);
5String output = datetime.format(newPattern);