public static Long dateToStamp(String s) throws ParseException {
String res;
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = simpleDateFormat.parse(s);
long ts = date.getTime();
res = String.valueOf(ts);
Long endDate = Long.parseLong(res);
return endDate;
}
【时间转时间戳-JAVA】
最新推荐文章于 2024-05-03 16:12:22 发布