62,614
社区成员
发帖
与我相关
我的任务
分享
try
{
SimpleDateFormat sdf = new SimpleDateFormat("MMM dd yyyy hh:mma",Locale.ENGLISH);
Date d=sdf.parse("Apr 22 2012 01:00PM ");
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
System.out.println(sdf.format( d ));
sdf = new SimpleDateFormat("yyyy-MM-dd hh:mma");
System.out.println(sdf.format( d ));
}catch (ParseException e) {
e.printStackTrace();
}