@Test public void isDateValid() throws Exception { assertTrue(DateTimeUtils.isDateValid("4 juillet 2001 12:08:56 EEST", Locale.FRENCH)); assertFalse(DateTimeUtils.isDateValid("Wed, Jul 4, '01", Locale.ENGLISH)); }
public static boolean isDateValid(String date, Locale locale) { try { DateFormat format = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, locale); format.parse(date); return true; } catch (ParseException e) { return false; } }
DateTimeUtils { public static boolean isDateValid(String date, Locale locale) { try { DateFormat format = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, locale); format.parse(date); return true; } catch (ParseException e) { return false; } } }
DateTimeUtils { public static boolean isDateValid(String date, Locale locale) { try { DateFormat format = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, locale); format.parse(date); return true; } catch (ParseException e) { return false; } }  }
DateTimeUtils { public static boolean isDateValid(String date, Locale locale) { try { DateFormat format = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, locale); format.parse(date); return true; } catch (ParseException e) { return false; } }  static boolean isUnix(String locale); static boolean isMilliseconds(String locale); static boolean isDateValid(String date, Locale locale); static Locale getLocaleByCountry(String lang, String country); static DateTime getJodaOrJavaDate(final DateTimeFormatter dateFormatter, final String date); static DateTimeFormatter getDateFormatter(String format, String lang, String country); static DateTimeFormatter formatWithDefault(String lang, String country); }
DateTimeUtils { public static boolean isDateValid(String date, Locale locale) { try { DateFormat format = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.DEFAULT, locale); format.parse(date); return true; } catch (ParseException e) { return false; } }  static boolean isUnix(String locale); static boolean isMilliseconds(String locale); static boolean isDateValid(String date, Locale locale); static Locale getLocaleByCountry(String lang, String country); static DateTime getJodaOrJavaDate(final DateTimeFormatter dateFormatter, final String date); static DateTimeFormatter getDateFormatter(String format, String lang, String country); static DateTimeFormatter formatWithDefault(String lang, String country);  }