List of utility methods to do Today
String | formatToDays(Date date) Formats a Date to the resolution of days: return getFormatToDays().format(date);
|
String | getAllToday() get All Today Date today = new Date(); return formatAllDate(today); |
int | getBetweenTodaysStartDateAndEndDate(Date startDate, Date endDate) get Between Todays Start Date And End Date int betweentoday = 0; if (null == startDate || null == endDate) return betweentoday; if (endDate == null) { Calendar calendar = Calendar.getInstance(); String year = new Integer(calendar.get(1)).toString(); String month = new Integer(calendar.get(2) + 1).toString(); String day = new Integer(calendar.get(5)).toString(); ... |
Calendar | getCalendarTodayZero(Calendar today) Returns the calendar from today with the first hour, minute, second and millisecond. Calendar calendarZero = new GregorianCalendar(Locale.getDefault()); calendarZero.set(today.get(Calendar.YEAR), today.get(Calendar.MONTH), today.get(Calendar.DATE), 0, 0, 0); calendarZero.set(Calendar.MILLISECOND, 0); return calendarZero; |
Date | getEndOfToday() get End Of Today return getEndOfDay(new Date()); |
Date | getFirstDate(Date today) get First Date Calendar calendar = Calendar.getInstance();
calendar.setTime(today);
calendar.set(Calendar.DATE, 1);
return calendar.getTime();
|
Calendar | getLastCalendarOfToday() get Last Calendar Of Today Calendar startCalendar = getStartCalendarOfToday();
Calendar endCalendar = Calendar.getInstance();
endCalendar.setTime(startCalendar.getTime());
endCalendar.set(Calendar.HOUR_OF_DAY, 23);
endCalendar.set(Calendar.MINUTE, 59);
endCalendar.set(Calendar.SECOND, 59);
return endCalendar;
|
Date | getNDaysFromToday(int n) get N Days From Today Calendar cal = Calendar.getInstance(Locale.GERMAN);
cal.add(Calendar.DAY_OF_YEAR, n);
return cal.getTime();
|
Date | getSomedayAfterToday(int x) get Someday After Today Calendar c = Calendar.getInstance();
c.set(Calendar.HOUR_OF_DAY, 0);
c.clear(Calendar.MINUTE);
c.clear(Calendar.SECOND);
c.clear(Calendar.MILLISECOND);
c.add(Calendar.DAY_OF_MONTH, x);
return c.getTime();
|
Calendar | getStartOfDayRelative(int daysFromToday) get Start Of Day Relative Calendar rtn = getBeginningOfDay();
rtn.add(Calendar.DATE, daysFromToday);
return rtn;
|