List of utility methods to do Day Add
String | addDay(java.util.Date dt, long day) add date SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); sdf.setTimeZone(getTimeZone()); return sdf.format(addDate(dt, day)); |
String | addDay(String currentdate, int add_day) add Day GregorianCalendar gc = null; SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); int year, month, day; try { year = Integer.parseInt(currentdate.substring(0, 4)); month = Integer.parseInt(currentdate.substring(5, 7)) - 1; day = Integer.parseInt(currentdate.substring(8, 10)); gc = new GregorianCalendar(year, month, day); ... |
Date | addDay(String d) add Day SimpleDateFormat sd = new SimpleDateFormat(DATE_FORMAT); Date daten = null; try { daten = sd.parse(d); } catch (ParseException e) { e.printStackTrace(); Calendar c = Calendar.getInstance(); ... |
String | addDay(String data) add Day SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Calendar cd = Calendar.getInstance(); try { cd.setTime(sdf.parse(data)); cd.add(5, 1); } catch (ParseException e) { e.printStackTrace(); return sdf.format(cd.getTime()); |
Date | addDay(String datetime, int day) add Day Calendar cal = Calendar.getInstance();
cal.setTime(parseDate(datetime));
cal.add(Calendar.DAY_OF_YEAR, day);
return cal.getTime();
|
long | addDayInterval(long millis, int dayInterval) addDayInterval Calendar calendar = new GregorianCalendar(TimeZone.getTimeZone("GMT")); calendar.setTimeInMillis(millis); calendar.add(Calendar.DAY_OF_MONTH, dayInterval); return calendar.getTimeInMillis(); |
Date | addDays(Date aDate, int days) Add days to a date by value. return addTime(aDate, (24 * days), Calendar.HOUR);
|
Date | addDays(Date baseDate, int amount, boolean endOfDay) Adds the specified number of days to the stated. Calendar cal = Calendar.getInstance(); synchronized (cal) { cal.setTime(baseDate); cal.add(Calendar.DATE, amount); if (endOfDay) { return endOfDay(cal.getTime()); return cal.getTime(); |
Date | addDays(Date beginDate, int days) add Days return changeTime(Calendar.DAY_OF_YEAR, beginDate, days);
|
Date | addDays(Date d, double count) add count days days is truncated to second and can be negative if (d == null) { return null; int sec = (int) (count * 3600 * 24); int sign = 1; if (sec < 0) { sec = -sec; sign = -1; ... |