1import java.time.*;
2import java.time.format.*;
3DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
4String input = "2021-02-05 13:07:35";
5LocalDateTime datetime = LocalDateTime.parse(input, formatter);
1import java.time.*;
2import java.time.format.*;
3DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm:ss");
4String input = "13:07:35";
5LocalTime time = LocalTime.parse(input, formatter);