Date date = new Date(); //创建时间对象
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); //创建时间格式
String time = sdf.format(date.getTime());//格式化当前时间
Date date = new Date(); //创建时间对象
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm"); //创建时间格式
String time = sdf.format(date.getTime());//格式化当前时间