例如:20180918/120023转换成2018-09-18 12:00:23
//时间格式转换
public String getNomalTime(String oldTime){
String newTime = "";
if(StringUtils.isNotBlank(oldTime)){
String reg = "(\\d{4})(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})";
newTime = oldTime.replace("/","").replaceAll(reg, "$1-$2-$3T$4:$5:$6");
} return newTime;
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)