获取当前时间时间戳
Calendar.getInstance().getTimeInMillis();
System.currentTimeMillis();
new Date().getTime();
时间格式化
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS");
System.out.println(sdf.format(new Date()));
Calendar.getInstance().getTimeInMillis();
System.currentTimeMillis();
new Date().getTime();
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS");
System.out.println(sdf.format(new Date()));