java localdate to string 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: localdate to string java
LocalDate today = LocalDate.now();
System.out.println(today.toString());
Example 3: get LocalDate in specified format
Format LocalDate in Java to required string