获取当前的时间,并将时间改为2019/11/25 11:00:00的格式 //创建date Date date=new Date(); //设置时间的格式 SimpleDateFormat dateFormat=new SimpleDateFormat("yyyy/MM/dd HH:mm:ss"); //将时间的格式,返回为一个String String createTime = dateFormat.format(date);