on-internet
← Community

Parsing Ambiguous Dates in Java

Stack Overflow ·

Is there any way in Java to guess the date format when it is not explicitly defined? For example a user types in 11Mar09 or 11-09-2009 or 11/09/2009 or 11-09 what is the best way of parsing this to a Date object without either a bunch of try catch or raising an error?

Comments

Sign in or sign up to comment and upvote.

No comments yet.