51,410
社区成员
发帖
与我相关
我的任务
分享
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date date = null;
try {
date = format1.parse("2009-10-12 12:12:12");
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
String strDate = formatter.format(date);
System.out.println("********" + strDate);
date="2009-10-12 10:30:12";
SimpleDateFormat sim=new SimpleDateFormat("yyyyMMddHHmmss");
sim.format(date);