List of utility methods to do Date Clear
Date | clearDate(Date date) clear Date Calendar c = Calendar.getInstance();
c.setTime(date);
c.set(Calendar.YEAR, 0);
c.set(Calendar.MONTH, 0);
c.set(Calendar.DATE, 0);
return c.getTime();
|
Date | clearDate(Date dateTime) clear Date if (dateTime == null) { return null; Calendar cal = Calendar.getInstance(); cal.setTime(dateTime); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); ... |
Date | clearDate(final Date date) Set hour, minute, second and millisecond to 0. if (date == null) { return null; final Calendar calendar = GregorianCalendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.MILLISECOND, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MINUTE, 0); ... |
void | clearDisplayFileCreationDateCache(final String absolutePath) Clears cache for "getDisplayFileCreationDate" method for specified file path. displayFileCreationDateCache.remove(absolutePath); |
Date | clearHourMinute(Date date) clear Hour Minute if (date == null) return null; Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.set(Calendar.HOUR, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.MILLISECOND, 0); return calendar.getTime(); ... |
Date | clearTime(Date date) clear Time Calendar calendar = getCalendarFromDate(date);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
return calendar.getTime();
|
Date | clearTime(Date date) clear Time Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.clear(Calendar.HOUR_OF_DAY);
cal.clear(Calendar.MINUTE);
cal.clear(Calendar.SECOND);
cal.clear(Calendar.MILLISECOND);
return cal.getTime();
|
void | clearTime(GregorianCalendar date) Clears the time in a Gregorian calendar date. date.set(Calendar.HOUR_OF_DAY, 0); date.set(Calendar.MINUTE, 0); date.set(Calendar.SECOND, 0); date.set(Calendar.MILLISECOND, 0); |
Date | clearTimeComponent(Date date) Given a Date object, returns a Date object for the same date but with the time component (hours, minutes, seconds & milliseconds) removed Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTime();
|