localdatetime format in java
xxxxxxxxxx
LocalDate today = LocalDate.now();
String formattedDate = today.format(DateTimeFormatter.ofPattern("dd-MMM-yy"));
System.out.println(formattedDate);
xxxxxxxxxx
LocalDate today = LocalDate.now();
String formattedDate = today.format(DateTimeFormatter.ofPattern("dd-MMM-yy"));
System.out.println(formattedDate);
xxxxxxxxxx
LocalTime time = LocalTime.parse("23:59:59");
DateTimeFormatter formatter = DateTimeFormatter.ISO_LOCAL_TIME;
String value = time.format(formatter);
xxxxxxxxxx
LocalDate localDate = LocalDate.now();//For reference
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd LLLL yyyy");
String formattedString = localDate.format(formatter);