System类中获取时间戳 long time = System.currentTimeMillis(); //返回当前时间与1970年1月1日0时0分0秒之间以毫秒为单位的时间差称为时间戳 System.out.println(time);