localdate to string java

Java
LocalDate today = LocalDate.now();
 
String formattedDate = today.format(DateTimeFormatter.ofPattern("dd-MMM-yy"));
 
System.out.println(formattedDate);LocalDate today = LocalDate.now();
         
System.out.println(today.toString());

Source

Also in Java: