Re: java.text.SimpleDateFormat
I don't see a problem with SimpleDateFormat; it doesn't try to guess, it tries to parse given the format string. If you say MM-dd-yyyy but give it 2008-11-24, you just told it month 2008. The following works as expected.
import java.text.DateFormat;
import java.text.SimpleDateFormat;
public class SimpleDateFormatTest {
public static void main(String[] args) throws java.text.ParseException {
DateFormat dfUSA = new SimpleDateFormat("MM/dd/yyyy");
System.out.println(dfUSA.parse("11/24/2008"));
DateFormat dfISO = new SimpleDateFormat("yyyy-MM-dd");
System.out.println(dfISO.parse("2008-11-24"));
}
}
which outputs
Mon Nov 24 00:00:00 EST 2008
Mon Nov 24 00:00:00 EST 2008
(I like keeping a DateFormat to a single date format, rather than changing the format string).