标签:时间 time simple parse new for mem java代码 current
时间戳转时间:
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();
标签:时间 time simple parse new for mem java代码 current
原文地址:https://www.cnblogs.com/syq816/p/9774592.html