天天看點

System和Date相關

System

//1970年1月1日0時0分0秒至現在的毫秒數。

//成為時間戳。

long time = System.currentTimeMillis();      

Date

Date date = new Date();

System.out.println(date.toString);      
Fri Dec 03 11:12:40 CST 2021

      
System.out.println(date.getTime);--擷取毫秒數。