Android Calendar Add getDateAdd(Date date, int amount)

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

Description

get Date Add

Declaration

public static Date getDateAdd(Date date, int amount) 

Method Source Code

//package com.java2s;

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);/*from  w w w  .j av  a2s  .c  om*/
        cal.add(GregorianCalendar.DATE, amount);
        return cal.getTime();
    }
}

Related

  1. add(int field, long time, int val)
  2. addDay(Calendar c, int days)
  3. addMonth(Calendar c, int months)
  4. after(Calendar c, long offset)
  5. afterNDays(Calendar c, int n)
  6. getDateByAddFltHour(float flt)
  7. getDateByAddHour(String datetime, int minute)
  8. getFormatCurrentAdd(int amount, String format)
  9. tomorrow(Calendar c)