yyyyMMddhhmmss(20140707103709)转换为yyyy-MM-dd HH:mm:ss(2014-07-07 10:37:09)

SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMddhhmmss");
Date date = (Date) sdf1.parse(s);
SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.print(sdf2.format(date));

©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页