1首先把字符串转成标准的时间格式:String time = "xxxxxxx";SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");String plan = sdf.format();2.再次转成Date sdf.parse(plan);
java怎样将string时间戳转换为date
1首先把字符串转成标准的时间格式:
String time = "xxxxxxx";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String plan = sdf.format();
2.再次转成Date
sdf.parse(plan);2017-10-17
new Date(String时间戳);2017-10-17