how to convert a fromdate of localdatetime type to custrom datetime format code example
Example 1: convert string to localdatetime
//convert String to LocalDateTime
String str = "2016-03-04 11:30";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm");
LocalDateTime dateTime = LocalDateTime.parse(str, formatter);
Example 2: how to parse a specific datetime to localdatetime
LocalDateTime date = LocalDateTime.parse("1995-07-25T15:03:45");