my dao page is receiving date and time from two different field now i want know how to merge these both date and time in a single object so that i calculate time difference and total time. I have this code to merge but it is not working what am i doing wrong in this code please help.
Date d = new SimpleDateFormat("yyyy-MM-dd").parse("2013-01-02");
Date t = new SimpleDateFormat("hh:mm:ss").parse("04:05:06");
LocalDate datePart = new LocalDate(d);
LocalTime timePart = new LocalTime(t);
LocalDateTime dateTime = datePart.toLocalDateTime(timePart);
System.out.println(dateTime);