@Test public void testStringToDateException() { try { Assert.assertEquals(jan_01_1901, DateUtil.stringToDate("la/2345/11", "MM/dd/yyyy")); Assert.fail("Exception not thrown on invalid date.[ ]"); } catch (ParseException pex) { } }
public static Date stringToDate(String strDate, String format) throws ParseException { if (StringUtil.isEmpty(strDate)) return null; SimpleDateFormat dtFormatter = new SimpleDateFormat(format); return dtFormatter.parse(strDate.trim()); }
DateUtil { public static Date stringToDate(String strDate, String format) throws ParseException { if (StringUtil.isEmpty(strDate)) return null; SimpleDateFormat dtFormatter = new SimpleDateFormat(format); return dtFormatter.parse(strDate.trim()); } }
DateUtil { public static Date stringToDate(String strDate, String format) throws ParseException { if (StringUtil.isEmpty(strDate)) return null; SimpleDateFormat dtFormatter = new SimpleDateFormat(format); return dtFormatter.parse(strDate.trim()); } private  DateUtil(); }
DateUtil { public static Date stringToDate(String strDate, String format) throws ParseException { if (StringUtil.isEmpty(strDate)) return null; SimpleDateFormat dtFormatter = new SimpleDateFormat(format); return dtFormatter.parse(strDate.trim()); } private  DateUtil(); static String dateToString(Date obj, String format); static Date stringToDate(String strDate, String format); static Date convertFlexibleDate(String strDate, String[] formats); static String convertShortDate(Date obj); static Date convertShortDate(String str); static Date convertShortDate(String str, Date defaultDate); static Date convertFlexibleDate(String strDate); static boolean compareNullableDates(Date date1, Date date2); static boolean hasTime(Date date); static Date getClientCurrentDate(final Calendar calendar, final TimeZone timeZone); static Date getDateFrom(int count, Date date); static Date getDayOfTheWeek(int day, int week, int year); static Date removeTime(Date date); }
DateUtil { public static Date stringToDate(String strDate, String format) throws ParseException { if (StringUtil.isEmpty(strDate)) return null; SimpleDateFormat dtFormatter = new SimpleDateFormat(format); return dtFormatter.parse(strDate.trim()); } private  DateUtil(); static String dateToString(Date obj, String format); static Date stringToDate(String strDate, String format); static Date convertFlexibleDate(String strDate, String[] formats); static String convertShortDate(Date obj); static Date convertShortDate(String str); static Date convertShortDate(String str, Date defaultDate); static Date convertFlexibleDate(String strDate); static boolean compareNullableDates(Date date1, Date date2); static boolean hasTime(Date date); static Date getClientCurrentDate(final Calendar calendar, final TimeZone timeZone); static Date getDateFrom(int count, Date date); static Date getDayOfTheWeek(int day, int week, int year); static Date removeTime(Date date);  }