List of utility methods to do Calendar Truncate
void | trim(final Calendar cal) This method will trim calendar to day by setting hour,min and sec to zero. cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); |
void | trimCalendar(Calendar cal) trim Calendar cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); |
void | trunc(Calendar calendar) Truncates a date object by setting to midnight of the current date. calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); |
void | truncate(Calendar calendar) Truncate the Calendar removing hours, minutes, seconds and milliseconds calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MILLISECOND, 0); |
Calendar | truncateCal(final Calendar cal) truncate Cal cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.HOUR, 0);
return cal;
|
void | truncCalendar(Calendar c) truncate the calendar to a day with time 00:00:00.000 c.set(Calendar.HOUR_OF_DAY, 0); c.set(Calendar.MINUTE, 0); c.set(Calendar.SECOND, 0); c.set(Calendar.MILLISECOND, 0); |
void | truncCalendarToQuarter(Calendar c) truncate the calendar to half year (i.e. if (c == null) { return; final int month = c.get(Calendar.MONTH); truncCalendarToYear(c); int quarterMonth = Calendar.JANUARY; switch (month) { case Calendar.APRIL: ... |