10 Replies Latest reply on Oct 25, 2009 3:02 PM by 800343

    SimpleDateFormat Problem


      I ran into a strange error today with SimpleDateFormat .

      In the following code:
      SimpleDateFormat format =
                  new SimpleDateFormat("yyyyMMddHHmmss");
                     Date date = format.parse("19850414000000");
                catch (ParseException e) 
      I receive an exception:
      java.text.ParseException: Unparseable date: "19850414000001"
           at java.text.DateFormat.parse(Unknown Source)
           at test.MainClass.main(MainClass.java:101)

      Could someone please tell me whats wrong with the date: 19850414000001 ?
      Actually after checking some more, all the times between 19850414000000 and 19850414005959 give this error while for example 19850414010000 or 19850413235959 work fine.
      Also this only happens for setLenient(false).

      What happened on the 14th of april 1985 that the Parser doesn't want to talk about?