+1 vote
by
How to change the date format from:
Sun May 20 00:00:00 GMT 03:00 2018
at:
2018-05-20 ?

1 Answer

0 votes
by
 
Best answer
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date date = new Date();
System.out.println(sdf.format(date));
...