Android Utililty Methods Date Add

List of utility methods to do Date Add

Description

The list of methods to do Date Add are organized into topic(s).

Method

TimestampaddMilliseconds(Date date, int amount)
add Milliseconds
return add(date, Calendar.MILLISECOND, amount);
DateaddMilliseconds(Date date, int amount)
Adds a number of milliseconds to a date returning a new object.
return add(date, Calendar.MILLISECOND, amount);
DateaddMinuteToDate(Date date, int minutesToBeAdded)
Add / Subtract given no of minutes to Date .
if (StringUtils.isNull(date)) {
    throw new NullPointerException("date cannot be null");
return add(date, Calendar.MINUTE, minutesToBeAdded);
TimestampaddMinutes(Date date, int amount)
add Minutes
return add(date, Calendar.MINUTE, amount);
DateaddMinutes(Date date, int amount)
Adds a number of minutes to a date returning a new object.
return add(date, Calendar.MINUTE, amount);
TimestampaddMonths(Date date, int amount)
add Months
return add(date, Calendar.MONTH, amount);
DateaddMonths(Date date, int amount)
Adds a number of months to a date returning a new object.
return add(date, Calendar.MONTH, amount);
DateaddMonthsToDate(Date date, int monthsToBeAdded)
Add / Subtract given no of months to Date .
if (StringUtils.isNull(date)) {
    throw new NullPointerException("date cannot be null");
return add(date, Calendar.MONTH, monthsToBeAdded);
TimestampaddSeconds(Date date, int amount)
add Seconds
return add(date, Calendar.SECOND, amount);
DateaddSeconds(Date date, int amount)
Adds a number of seconds to a date returning a new object.
return add(date, Calendar.SECOND, amount);