java formate localdatetime code example
Example 1: format localdate java
LocalDate today = LocalDate.now();
String formattedDate = today.format(DateTimeFormatter.ofPattern("dd-MMM-yy"));
System.out.println(formattedDate);
Example 2: java localtime format
LocalTime time = LocalTime.parse("23:59:59");
DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_TIME;
String value = time.format(formatter);