java format date yyyy-mm-dd code example
Example 1: java date to string yyyy-mm-dd
java.util.Date date = new Date("Sat Dec 01 00:00:00 GMT 2012");
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
String format = formatter.format(date);
System.out.println(format);
Example 2: javascript format date yyyy-mm-dd
let today = new Date()
today.toISOString().split('T')[0]
Example 3: js date format yyyy-mm-dd
yourDate.toISOString().split('T')[0]