Java Utililty Methods Day From

List of utility methods to do Day From

Description

The list of methods to do Day From are organized into topic(s).

Method

StringgetTimeField(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);
booleanisBusinessDay(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) {
...
booleanisDefaultWorkingDay(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);
booleanisOneDayZeroPoint(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;
DatenextDay(Date date)
Returns the day after date.
return new Date(addDays(date.getTime(), 1));
DatenextDay(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();
DatestartOfDay(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();
...
DatestartOfDay(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);
...