Working on some bugs related to the DateField component. Did you know that (for US English, anyway) DateFormat.getDateInstance(DateFormat.SHORT) provides back a DateFormat equivalent to "M/d/yy"?
That's a problem, because it has a tendency to format Dates to be two digit years. When it parses those same strings, it ends up considering the date to be in the first century AD.
Thus in this code:
Date date1 = new Date(...); Date date2 = format.parse(format.format(date1));
date2 may or may not be the same as date1. Certainly any time information will be stripped out (this is expected), but often date2 will be in the wrong century.
I'm working right now to get the correct localized DateFormat, but ensure that the year portion is four digits, not two.