Java Day Add addDays(Date startDate, int numDays)

Here you can find the source of addDays(Date startDate, int numDays)

Description

add Days

License

Open Source License

Declaration

public static Date addDays(Date startDate, int numDays) 

Method Source Code


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

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

public class Main {
    public static Date addDays(Date startDate, int numDays) {
        Calendar inst = GregorianCalendar.getInstance();
        inst.setTime(startDate);//ww w .  ja v  a  2 s.c om
        inst.add(Calendar.DAY_OF_YEAR, numDays);
        return inst.getTime();
    }
}

Related

  1. addDays(Date date, int daysOffset, boolean stripTime)
  2. addDays(Date date, int daysToAdd)
  3. addDays(Date date, int i)
  4. addDays(Date dt, int numDays)
  5. addDays(Date start, int days)
  6. addDays(Date when, int amount)
  7. addDays(final Date date, final int addDays)
  8. addDays(final Date date, final int days)
  9. addDays(final Date date, final int days)