Date today=new Date();
DateFormate fmt=getDateTimeInstance(Loacal.SHORT,Local.CHINA);
String formatted=fmt.formate(today);

解决方案 »

  1.   

    问题首先是“Mar 8, 2000 9:28:49 PM”的字符串怎么转换到Date类型中!
      

  2.   

    “Mar 8, 2000 9:28:49 PM”的字符串转换到Date类型中
    用到的API:
    SimpleDateFormat df = new SimpleDateFormat(String fmt);
    Date d = df.parse(String);
    具体fmt怎么写,自己去看API吧
      

  3.   

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
    DateFormat df = DateFormat.getDateInstance();
    Date d = df.parse("Mar 8, 2000 9:28:49 PM");
    Date newDate = sdf.format(d);
      

  4.   

    抛出异常:
    java.text.ParseException: Unparseable date: "Mar 8, 2000 9:28:49 PM"
    at java.text.DateFormat.parse(DateFormat.java:324)
    at test.main(test.java:29)