显示 “下午” 是因为 Locale.getDefault() 是 中国的原因。

解决方案 »

  1.   

    SimpleDateFormat sdf3=new SimpleDateFormat("MM/dd/yyyy a",Locale.ENGLISH); 
      

  2.   

      标准答案:
                    String date3="2009/03/02 13:12:12 ";
    SimpleDateFormat sdf2=new SimpleDateFormat("yyyy/MM/dd hh:MM:ss");
    Date d3 = sdf2.parse(date3);
    SimpleDateFormat sdf3=new SimpleDateFormat("MM/dd/yyyy hh:MM:ss a",Locale.US);
    String date4=sdf3.format(d3);
    System.out.println(date4);          O(∩_∩)O哈哈~
      

  3.   

    还是大写的PM呀~~
      希望出现小写的pm。
      

  4.   

    sdf3.format(date).toLowerCase();
    ..表太钻牛角尖啦。。
      

  5.   

    要求好严格 直接用.toLowerCase()吧