Java Utililty Methods Day of Month

List of utility methods to do Day of Month

Description

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

Method

DateadjustToDayOfMonth(Date dt, int day)
adjust To Day Of Month
Calendar cal = Calendar.getInstance();
Date newDate = new Date(dt.getTime());
cal.setTime(newDate);
cal.set(Calendar.DAY_OF_MONTH, day);
return resetTime(cal.getTime());
intdayOfMonth(Date date)
day Of Month
return dateField(date, Calendar.DAY_OF_MONTH);
intdayOfMonthOf(Date date)
Dates Extracts the day of month of the given Date.
return toCalendar(date).get(Calendar.DAY_OF_MONTH);
intgetDayofMonth(Date date)
get Dayof Month
GregorianCalendar cal = getCalender(date, false);
return cal.get(Calendar.DAY_OF_MONTH);
intgetDayOfMonth(Date date)
Return day of month.
return getCalendar(date).get(Calendar.DAY_OF_MONTH);
shortgetDayOfMonth(Date date)
get Day Of Month
assertDateParamsRequired(date);
Calendar c = Calendar.getInstance();
c.setTime(date);
return (short) c.get(Calendar.DAY_OF_MONTH);
intgetDayOfMonth(Date date)
get Day Of Month
Calendar calendar = getCalendarFromDate(date);
return calendar.get(Calendar.DAY_OF_MONTH);
intgetDayOfMonth(Date date)
get Day Of Month
Calendar c = getCalendar();
c.setTime(date);
return c.getActualMaximum(Calendar.DAY_OF_MONTH);
intgetDayOfMonth(Date dt)
Get and return the day of month from the given Date dt
Calendar cal = new GregorianCalendar();
cal.setTime(dt);
return (cal.get(Calendar.DAY_OF_MONTH));
intgetDayOfMonth(final Date date)
Get the day of the month by given date.
return getNumberOfGranularity(Calendar.DAY_OF_MONTH, date);