local date to string java code example
Example 1: date to string java
Date date = Calendar.getInstance().getTime();
DateFormat dateFormat = new SimpleDateFormat("yyyy-mm-dd hh:mm:ss");
String strDate = dateFormat.format(date);
Example 2: localdate to string java
LocalDate today = LocalDate.now();
System.out.println(today.toString());