Something like that:
try {
Date date = DateTimeFormat.getFormat(PredefinedFormat.DATE_SHORT).parseStrict(value);
} catch (IllegalArgumentException e) {
}
You can use a different format, obviously, or you can try to parse all the formats one by one if you allow your users to freely enter dates as 1/1/2013, as well as Jan 1, 2013, January 1, 2013etc.
source
share