1//parse ISO local date time String
2LocalDateTime timestamp=LocalDateTime.parse("2007-12-03T10:15:30");
3//parse custom String
4DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy MM dd HH:mm");
5LocalDate parsedDate = LocalDate.parse("1970 01 01 00:00", formatter);
1//Timestamp to HH:mm:ss format
2Long Timestamp = 1633304782;
3Date timeD = new Date(Timestamp * 1000);
4SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
5
6String Time = sdf.format(timeD);
7
8//RESULT this code convert 1633304782 to 05:46:33
1All you need to do is change the string within the java.text.SimpleDateFormat constructor to: "MM-dd-yyyy HH:mm:ss".
2
3Just use the appropriate letters to build the above string to match your input date.