//将Date类型转为时间戳 private Long getTimeStamp(Date date) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String format = sdf.format(date); Long time=null; try { time = sdf.parse(format).getTime(); } catch (ParseException e) { e.printStackTrace(); } return time; }
Java:将Date类型转为时间戳
最新推荐文章于 2024-08-01 04:44:06 发布