下面这个出现错误
怎么写格式String date="8/8/2007 8:44 PM";
DateFormat df = new SimpleDateFormat("M/d/yyyy h:mm a");
Date d=df.parse(date);
怎么写格式String date="8/8/2007 8:44 PM";
DateFormat df = new SimpleDateFormat("M/d/yyyy h:mm a");
Date d=df.parse(date);
SimpleDateFormat df = new SimpleDateFormat("...")
String date="8/8/2007 8:44 PM";
DateFormat df = new SimpleDateFormat("M/d/yyyy h:mm a", Locale.ENGLISH);
java.util.Date d = df.parse(date);
我想把
8/8/2007 8:44 PM
转换成
August 8, 2007 8:44 PM
有没有简单点的方法呢
SimpleDateFormat df = new SimpleDateFormat("M/d/yyyy h:mm a", Locale.ENGLISH);
Date d=df.parse(date);
String str = String.format(Locale.ENGLISH, "%tB %<te, %<tY %<tl:%<tM %<Tp", d);
System.out.println(str);