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