一、通过系统System.currentTimeMillis()或者其他路经获取毫秒级的long类型时间
long time System.currentTimeMillis()
二、定义时间显示格式
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
三、将获取的时间放入所定义的时间格式中
String result = format.format(new Date(date));
一、通过系统System.currentTimeMillis()或者其他路经获取毫秒级的long类型时间
long time System.currentTimeMillis()
二、定义时间显示格式
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm:ss");
三、将获取的时间放入所定义的时间格式中
String result = format.format(new Date(date));