add(Date date, int timeValue, UnitOfTime uot) method adds the given number(time value) of units to the given date.
public Boolean getCompletionDate(Date startDate, Integer timeValue, UnitOfTime uot){
Date completionDate = DateUtil.add(startDate, timeValue, uot);
return completionDate ;
}
Alternatively, any of the following methods can be used if the unit of time is known and not given.
- addYears(Date date, int numberOfYears) method adds the given number of years to the given date.
- addMonths(Date date, int numberOfMonths) method adds the given number of months to the given date.
- addWeeks(Date date, int numberOfWeeks) method adds the given number of weeks to the given date.
- addDays(Date date, int numberOfDays) method adds the given number of days to the given date.
- addHours(Date date, int numberOfHours) method adds the given number of hours to the given date.
- addMinutes(Date date, int numberOfMinutes) method adds the given number of minutes to the given date.
- addSeconds(Date date, int numberOfSeconds) method adds the given number of seconds to the given date.