List of utility methods to do Day From
Date | getDateFromDayNum(int dayNum) get Date From Day Num Calendar calendar = Calendar.getInstance(); calendar.setTime(new Date()); calendar.set(Calendar.DAY_OF_MONTH, dayNum); return calendar.getTime(); |
Date | getDateUpDay(Date d) get Date Up Day if (d != null) { Calendar a = Calendar.getInstance(); a.setTime(d); a.add(Calendar.DATE, +1); d = a.getTime(); return (d); |
int | getDay(Date date) get Day return getDatePar(Calendar.DAY_OF_MONTH, date);
|
Date | getDay(Date date) Gets a date with on the date portion Calendar c = Calendar.getInstance();
c.setTime(date);
c.set(Calendar.HOUR_OF_DAY, 0);
c.set(Calendar.MINUTE, 0);
c.set(Calendar.SECOND, 0);
c.set(Calendar.MILLISECOND, 0);
return c.getTime();
|
Date | getDay(Date date, int day) get Day long currDateMills = date.getTime(); long extraMills = day * 3600 * 1000 * 24; Calendar result = Calendar.getInstance(); result.setTimeInMillis(currDateMills + extraMills); return result.getTime(); |
int | getDay(String date) get Day date = deleteSlash(date);
date = deleteDash(date);
return Integer.parseInt(date.substring(6, 8));
|
Date | getDay0(Date date) get Day Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
return calendar.getTime();
|
int | getDayOfDate(Date date) get Day Of Date Calendar c = Calendar.getInstance();
c.setTime(date);
return c.get(Calendar.DATE);
|
int | getDays(Date date1, Date date2) get Days Long days = date1.getTime() - date2.getTime(); return (int) (days / 1000 / 3600 / 24); |
int | getDays(Date sd, Date ed) get Days return (int) ((ed.getTime() - sd.getTime()) / (3600 * 24 * 1000)); |