Android Date Add addDaysToDate(Date date, int days)

Here you can find the source of addDaysToDate(Date date, int days)

Description

add Days To Date

License

Open Source License

Declaration

public static Date addDaysToDate(Date date, int days) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Date;

public class Main {
    private static final long ONE_DAY_IN_MILLIS = 24 * 60 * 60 * 1000;

    public static Date addDaysToDate(Date date, int days) {
        long epochTime = date.getTime() + (days * ONE_DAY_IN_MILLIS);
        return new Date(epochTime);
    }/*from   w  w  w . j  a v a2  s  .c  o m*/
}

Related

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