private SimpleDateFormat dateformat; private long time; private long getMills(){ dateformat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //时间格式 try { time = dateformat.parse("1971-01-01 00:00:00").getTime();//格式转换 System.out.println(time); } catch (java.text.ParseException e) { e.printStackTrace(); } return time; }
时间转换成毫秒值
最新推荐文章于 2023-07-14 18:30:00 发布