List of utility methods to do Day From
String | getTimeField(Date day, int field) get Time Field if (day == null) return null; Calendar c = Calendar.getInstance(); c.setTime(day); return c.get(field) < 10 ? "0" + c.get(field) : "" + c.get(field); |
boolean | isBusinessDay(int dateIntToCheck) is Business Day Boolean result = ibdMemo.get(dateIntToCheck); if (result != null) return result; Date dateToCheck = convertToDate(dateIntToCheck); Calendar baseCal = Calendar.getInstance(); baseCal.setTime(dateToCheck); List<Date> offlimitDates; synchronized (computedDates) { ... |
boolean | isDefaultWorkingDay(Date date) is Default Working Day Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int week = calendar.get(Calendar.DAY_OF_WEEK); return !(week == 7 || week == 1); |
boolean | isOneDayZeroPoint(Date date) is One Day Zero Point if (date != null) { long time = date.getTime() + ONE_DAY_MILLISECONDS / 3; if (time % ONE_DAY_MILLISECONDS == 0) { return true; return false; |
Date | nextDay(Date date) Returns the day after date .
return new Date(addDays(date.getTime(), 1)); |
Date | nextDay(Date date, int day) next Day Calendar cal = Calendar.getInstance(); if (date != null) { cal.setTime(date); cal.add(Calendar.DAY_OF_YEAR, day); return cal.getTime(); |
Date | startOfDay(Date date) Returns a new Date with the hours, milliseconds, seconds and minutes set to 0. Calendar calendar = CALENDAR; synchronized (calendar) { calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MILLISECOND, 0); calendar.set(Calendar.SECOND, 0); calendar.set(Calendar.MINUTE, 0); return calendar.getTime(); ... |
Date | startOfDay(Date datum) start Of Day if (datum == null) { return null; Calendar cal = new GregorianCalendar(); cal.setTime(datum); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); ... |