小弟编了个小程序,编译能通过,但一运行就报错,报错内容为“Illegal pattern character 'Y'”,报错地点如下:SimpleDateFormat formatter = new SimpleDateFormat("YYYY MM DD HH MM");请大家帮帮忙!

解决方案 »

  1.   

    SimpleDateFormat formatter = new SimpleDateFormat("yyyy MM dd hh mm")case sensitive!
      

  2.   

    private static SimpleDateFormat longFormatter = 
            new SimpleDateFormat ("yyyyMMddHHmmss");
     
     private static SimpleDateFormat timeStampFormatter = 
            new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");
      

  3.   

    谢谢 midlet 和 catblue 的帮助,非常感谢!