SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式 String date=df.format(new Date()); 格式可以任意设定。