@Test public void testHasTime() throws ParseException { Assert.assertTrue(DateUtil.hasTime(new Date())); Assert.assertFalse(DateUtil.hasTime(DateUtil.convertFlexibleDate("2001-01-02"))); Assert.assertFalse(DateUtil.hasTime(null)); }
public static boolean hasTime(Date date) { if (date == null) return false; Calendar cal = Calendar.getInstance(); cal.setTime(date); return (cal.get(Calendar.HOUR_OF_DAY) + cal.get(Calendar.MINUTE) + cal.get(Calendar.SECOND) + cal.get(Calendar.MILLISECOND) > 0); }
DateUtil { public static boolean hasTime(Date date) { if (date == null) return false; Calendar cal = Calendar.getInstance(); cal.setTime(date); return (cal.get(Calendar.HOUR_OF_DAY) + cal.get(Calendar.MINUTE) + cal.get(Calendar.SECOND) + cal.get(Calendar.MILLISECOND) > 0); } }
DateUtil { public static boolean hasTime(Date date) { if (date == null) return false; Calendar cal = Calendar.getInstance(); cal.setTime(date); return (cal.get(Calendar.HOUR_OF_DAY) + cal.get(Calendar.MINUTE) + cal.get(Calendar.SECOND) + cal.get(Calendar.MILLISECOND) > 0); } private  DateUtil(); }
DateUtil { public static boolean hasTime(Date date) { if (date == null) return false; Calendar cal = Calendar.getInstance(); cal.setTime(date); return (cal.get(Calendar.HOUR_OF_DAY) + cal.get(Calendar.MINUTE) + cal.get(Calendar.SECOND) + cal.get(Calendar.MILLISECOND) > 0); } 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 boolean hasTime(Date date) { if (date == null) return false; Calendar cal = Calendar.getInstance(); cal.setTime(date); return (cal.get(Calendar.HOUR_OF_DAY) + cal.get(Calendar.MINUTE) + cal.get(Calendar.SECOND) + cal.get(Calendar.MILLISECOND) > 0); } 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);  }