There was a bug in DateFormat.parse that was fixed in 1.1.6, and
stays fixed in later releases. If you try to search our bug database
for this bug, all you find is chaos.
I am filing this bug retroactively to clarify things. Here is the
program that clearly demonstrates what is wrong with 1.1.5. It also
shows that things have been fixed in 1.1.6.
----
import java.util.Date;
import java.text.SimpleDateFormat;
public class ParseProblem_022900 {
public static void main(String[] args) throws Exception {
System.out.println(System.getProperty("java.version"));
SimpleDateFormat format = new SimpleDateFormat("MM/dd/yy");
String input = "02/29/00";
Date date = format.parse(input);
System.out.println("input = " + input +
", format = " + format.toPattern() +
", output = " + date);
}
}
-----
$ $ulj/jdk1.1.5/solaris/bin/java ParseProblem_022900
1.1.5
input = 02/29/00, format = MM/dd/yy, output = Wed Mar 01 00:00:00 PST 2000
$ $ulj/jdk1.1.6/solaris/bin/java ParseProblem_022900
1.1.6
input = 02/29/00, format = MM/dd/yy, output = Tue Feb 29 00:00:00 PST 2000
I am closing this bug as integrated in 1.1.6.
anand.palaniswamy@Eng 1999-02-23
stays fixed in later releases. If you try to search our bug database
for this bug, all you find is chaos.
I am filing this bug retroactively to clarify things. Here is the
program that clearly demonstrates what is wrong with 1.1.5. It also
shows that things have been fixed in 1.1.6.
----
import java.util.Date;
import java.text.SimpleDateFormat;
public class ParseProblem_022900 {
public static void main(String[] args) throws Exception {
System.out.println(System.getProperty("java.version"));
SimpleDateFormat format = new SimpleDateFormat("MM/dd/yy");
String input = "02/29/00";
Date date = format.parse(input);
System.out.println("input = " + input +
", format = " + format.toPattern() +
", output = " + date);
}
}
-----
$ $ulj/jdk1.1.5/solaris/bin/java ParseProblem_022900
1.1.5
input = 02/29/00, format = MM/dd/yy, output = Wed Mar 01 00:00:00 PST 2000
$ $ulj/jdk1.1.6/solaris/bin/java ParseProblem_022900
1.1.6
input = 02/29/00, format = MM/dd/yy, output = Tue Feb 29 00:00:00 PST 2000
I am closing this bug as integrated in 1.1.6.
anand.palaniswamy@Eng 1999-02-23