java内部时间转化代码
package t;
import java.text.SimpleDateFormat;
import java.util.Date;
public class c {
public static void main(String[] args) {
SimpleDateFormat simpleDateFormat = null;
simpleDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
long time = 1612164195000l;
Date date = new Date(time);
String day = simpleDateFormat.format(date);
simpleDateFormat = new SimpleDateFormat("HH:mm:ss");
String time2 = simpleDateFormat.format(date);
System.out.println(day+" "+time2);
// System.out.println(System.currentTimeMillis());
//1611723733000
}
}
注意:
long time = 1612164195000l;中将最后一位前的时间编码替换,点击运行就可解码时间