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));
yyyyMMddhhmmss(20140707103709)转换为yyyy-MM-dd HH:mm:ss(2014-07-07 10:37:09)
最新推荐文章于 2024-10-30 00:05:14 发布