日期:2014-05-20 浏览次数:20754 次
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(); }