You just need to use the correct methods instead of calling the constructors. Use parse
to create local dates and local time objects, then pass two objects to the method of
LocalDateTime
:
LocalDate datePart = LocalDate.parse("2013-01-02");
LocalTime timePart = LocalTime.parse("04:05:06");
LocalDateTime dt = LocalDateTime.of(datePart, timePart);
EDIT
-, Date
2 . , , SimpleDateFormat
. , .
String startingDate = new SimpleDateFormat("yyyy-MM-dd").format(startDate);
String startingTime = new SimpleDateFormat("hh:mm:ss").format(startTime);