Parsing strings to dates with unknown formats
807589Sep 22 2008 — edited Sep 23 2008I've perused Java's standard libraries and Joda-time's APIs for date parsing tools, but can't find anything good. I'm reading dates from files where the format is not standardized. So I don't know if it'll be in YYYY-MM-dd or fully spelled out. Also, the dates may be from a LONG time ago, before the 15th century, which is when I understand the Date class stops working properly.
Anybody have any suggestions? I guess I can use Joda-time's DateTimeFormat.forPattern("YYYY-etc...").parse(dateString), catch the formatting exception and try alternative formats successively.... Or do this all manually. But I'm hoping there's a better way and someone has thought of how to handle this. Other's MUST'VE run into this issue before!!