new java.text.SimpleDateFormat("yyyy-MM-dd").format(new java.text.SimpleDateFormat("hh:mm").parse. code example
Example 1: date format in java
String pattern = "yyyy-MM-dd";
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
String date = simpleDateFormat.format(new Date());
System.out.println(date);
Example 2: date format in java
String pattern = "yyyy-MM-dd";
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
Date date = simpleDateFormat.parse("2018-09-09");