I don't know why this happens but when I attempt to parse certain dates they are not parsed correctly. Take the following example.
The output I get by setting the leniency to true in the DateFormat is:
Date 1: Sun Jan 06 03:00:00 EDT 1974
Date 2: Sun Jan 06 03:00:00 EDT 1974
Now if I set the leniency to false I get the following:
java.text.ParseException: Unparseable date: "197401060200"
at java.text.DateFormat.parse(DateFormat.java:337)
at main.main(main.java:16)
Date 1: null
Date 2: Sun Jan 06 03:00:00 EDT 1974
The application I am working on will get a use the ResultSet getTimeSpamp() method to create a java.util.Date. I get the same behavior from this as well. I only discovered this because I have duplicate dates where I shouldn't have. I have counted 33 occurrences from 1974-2009. Does anyone know why this happens? Thanks.