时间戳转时间:
SimpleDateFormat simpleDateFormat = null; simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
Date date = new Date(System.currentTimeMillis()); String day = simpleDateFormat.format(date);
simpleDateFormat = new SimpleDateFormat("HHmmss"); String time = simpleDateFormat1.format(date);
时间转时间戳
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date = simpleDateFormat.parse(s); long ts = date.getTime();
原文地址:https://www.cnblogs.com/syq816/p/9774592.html
时间: 2024-11-05 10:58:36