Android Date Add getDateAdd(Date date, int amount)

Here you can find the source of getDateAdd(Date date, int amount)

Description

get Date Add

License

Apache License

Declaration

public static Date getDateAdd(Date date, int amount) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

public class Main {

    public static Date getDateAdd(Date date, int amount) {
        Calendar cal = new GregorianCalendar();
        cal.setTime(date);// w ww  .  j  a  v a2s  . c o  m
        cal.add(GregorianCalendar.DATE, amount);
        return cal.getTime();
    }
}

Related

  1. addWeeks(Date date, int amount)
  2. addYearToDate(Date date, int yearsToBeAdded)
  3. addYears(Date date, int amount)
  4. addYears(Date date, int amount)
  5. dateByAddHoursAndMinutes(Date date, int hours, int minutes)
  6. addDaysToDate(Date date, int days)
  7. addTimeInterval(Date origin, int value, int unit)