Konwertuj DATETIME na format niestandardowy w Java 8

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);
kutty39