@Test public void testConvertShortDate() throws ParseException{ Assert.assertEquals(mar_16_1989,DateUtil.convertShortDate("19890316")); Assert.assertEquals(jun_30_1932,DateUtil.convertShortDate("19320630")); Assert.assertEquals("19320630", DateUtil.convertShortDate(jun_30_1932)); Assert.assertEquals("19890316", DateUtil.convertShortDate(mar_16_1989)); Assert.assertEquals(jun_30_1932,DateUtil.convertShortDate("19320630",mar_16_1989)); }
public static String convertShortDate(Date obj) { return dateToString(obj, "yyyyMMdd"); }
DateUtil { public static String convertShortDate(Date obj) { return dateToString(obj, "yyyyMMdd"); } }
DateUtil { public static String convertShortDate(Date obj) { return dateToString(obj, "yyyyMMdd"); } private  DateUtil(); }
DateUtil { public static String convertShortDate(Date obj) { return dateToString(obj, "yyyyMMdd"); } 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 String convertShortDate(Date obj) { return dateToString(obj, "yyyyMMdd"); } 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);  }