@Test public void testGetTime() throws Exception { Calendar cal = Calendar.getInstance(); cal.set(2015, Calendar.FEBRUARY, 23, 15, 0, 0); Date time = DateHelper.getTime(cal.getTime()); assertTrue(DateHelper.isOnlyTime(time)); }
public static Date getTime(Date datetime) { Date time = new Date(0); time.setHours(datetime.getHours()); time.setMinutes(datetime.getMinutes()); time.setSeconds(datetime.getSeconds()); return time; }
DateHelper { public static Date getTime(Date datetime) { Date time = new Date(0); time.setHours(datetime.getHours()); time.setMinutes(datetime.getMinutes()); time.setSeconds(datetime.getSeconds()); return time; } }
DateHelper { public static Date getTime(Date datetime) { Date time = new Date(0); time.setHours(datetime.getHours()); time.setMinutes(datetime.getMinutes()); time.setSeconds(datetime.getSeconds()); return time; } private  DateHelper(); }
DateHelper { public static Date getTime(Date datetime) { Date time = new Date(0); time.setHours(datetime.getHours()); time.setMinutes(datetime.getMinutes()); time.setSeconds(datetime.getSeconds()); return time; } private  DateHelper(); static String format(Date dt); static String format(Date dt, String pattern); static String formatShortDate(Date dt); static String formatShortTime(Date dt); static String formatISO8601(Date dt); static Calendar getEmptyCalendar(); static Calendar calendar(int year, int month, int day); static Date date(int year, int month, int day); static Date beginOfDay(Date dt); static Date endOfDay(Date dt); static int diffDays(Date dtEnd, Date dtBegin); static Date setTime(Date date, Date time); static Date getTime(Date datetime); static boolean isOnlyTime(Date dt); static boolean isOnlyDate(Date dt); static Date addDays(Date date, int count); static boolean isEmpty(Date date); static String[] getWeekdays(); static String[] getShortWeekdays(); static int[] getIndexWeekdays(); }
DateHelper { public static Date getTime(Date datetime) { Date time = new Date(0); time.setHours(datetime.getHours()); time.setMinutes(datetime.getMinutes()); time.setSeconds(datetime.getSeconds()); return time; } private  DateHelper(); static String format(Date dt); static String format(Date dt, String pattern); static String formatShortDate(Date dt); static String formatShortTime(Date dt); static String formatISO8601(Date dt); static Calendar getEmptyCalendar(); static Calendar calendar(int year, int month, int day); static Date date(int year, int month, int day); static Date beginOfDay(Date dt); static Date endOfDay(Date dt); static int diffDays(Date dtEnd, Date dtBegin); static Date setTime(Date date, Date time); static Date getTime(Date datetime); static boolean isOnlyTime(Date dt); static boolean isOnlyDate(Date dt); static Date addDays(Date date, int count); static boolean isEmpty(Date date); static String[] getWeekdays(); static String[] getShortWeekdays(); static int[] getIndexWeekdays(); static final String DATE_FORMAT_ISO8601; }