02/Oct/2019:11:55:28 类型的时间转换为

public static String upDataTime(String time) {
Date upTime = new Date();
String newtime = null;
SimpleDateFormat format = new SimpleDateFormat("dd/MMM/yyyy:HH:mm:ss",Locale.US );
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
upTime = format.parse(time);
newtime = sdf.format(upTime);
} catch (ParseException e) {
e.printStackTrace();
}
return newtime.toString();
}

posted @ 2019-11-29 16:31  君莫笑我十年游  阅读(255)  评论(0编辑  收藏  举报