I often use Date.parse(String) to parse a date in an unknown format. It seems to work fine for my use cases so far, but I'm wondering why it was deprecated, and whether I should avoid it? The docs just say:
As of JDK version 1.1, replaced by DateFormat.parse(String s)
However, there's no static parse method in DateFormat, just an instance method, which requires a DateFormat object, which I won't have for an unknown date format.
So, I'm wondering...
- Is there any official statement somewhere from the Java designers about why they chose to deprecate it?
- If this method works fine for my use cases so far, can I rely on this functionality being available in future versions of Java?
- Is there a viable alternative that is not deprecated for parsing a string that is in one of many possible common date formats?