Sorry to ask if this is a duplicate question as I try to find solutions online but couldn't get a confirmed answer.
I would like to know the possible values that can be used to parse using SimpleDateFormat method in Java. For examples, the minimum and maximum values that can be parsed without error.
My date format is in yyyy-MM-dd
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
1900-01-01 seems to be a valid one, but not 9999-12-31. The maximum date "valid" for me is 4637-11-25, any possible reason for this?
LocalDate. See the answer.DateFormatandSimpleDateFormatwere notorious troublemakers and have fortunately been outdated for 10 years now. I recommend you forget about them.9999-12-31or any date later than 4637-11-25? Exception? If so, paste the stack trace into your question, formatted as code. Wrong result? If so, which result? Without such debugging details I can’t see we have a chance to guess what goes on.