SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String date=sdf.format(new Date());

yyyy-MM-dd 中的MM一定要大写.

...

,