List of utility methods to do Day Add
String | addDays(String startDate, int amount) add Days SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar cal = Calendar.getInstance(); cal.setTime(sdf.parse(startDate)); cal.add(Calendar.DAY_OF_MONTH, amount); long mills = cal.getTimeInMillis(); Date date = new Date(mills); return sdf.format(date); |
Date | addDays2Date(Date d, int days) add Days Date calendar.clear();
calendar.setTime(d);
calendar.add(Calendar.DAY_OF_MONTH, days);
return calendar.getTime();
|
Date | addDays2Date(String str, int days) add Days Date SimpleDateFormat fmt = new SimpleDateFormat("yyyyMMdd"); Date date = fmt.parse(str); date.setTime(date.getTime() + (long) days * 1000L * 60L * 60L * 24L); return date; |
String | addDaysByFormatter(int days, String dateFormat) get specified time string in specified date format. Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); cal.add(Calendar.DATE, days); SimpleDateFormat formatter = new SimpleDateFormat(dateFormat); return formatter.format(cal.getTime()); |
java.util.Date | addDaysDate(final java.util.Date date1, final int nbdays) add Days Date if (date1 == null) { return null; final GregorianCalendar cal = new GregorianCalendar(); cal.setTime(date1); cal.add(Calendar.DATE, nbdays); return cal.getTime(); |
Date | addDaysOnDate(final Date date, final int numberOfDays) Adds days on Date. Date addedDate = null; if (date != null) { final Calendar calendar = new GregorianCalendar(); calendar.setTime(date); calendar.add(Calendar.DATE, numberOfDays); addedDate = calendar.getTime(); return addedDate; ... |
Date | addDaysToDate(Date date, int numDays) add Days To Date Calendar c = Calendar.getInstance();
c.setTime(date);
c.add(Calendar.DATE, numDays);
return c.getTime();
|
Date | addDaysToDate(Date date, int value) Adds value days to date .
Calendar calendar = getCalendar(date);
calendar.add(Calendar.DATE, value);
return calendar.getTime();
|
Date | addDaysToDate(final Date d, final int days) Adds days to a Date. Calendar cal = getStockExchangeCalendar();
cal.setTime(d);
cal.add(Calendar.DAY_OF_MONTH, days);
return cal.getTime();
|
Date | addDaysToDate(String s, int day, String format) return add day to date object with user defined format. Date date = check(s, format);
return addDaysToDate(date, day);
|