Java Date Add addDates(Date startDate, int days)

Here you can find the source of addDates(Date startDate, int days)

Description

add Dates

License

Apache License

Declaration

public static Date addDates(Date startDate, int days) 

Method Source Code

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

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

public class Main {

    public static Date addDates(Date startDate, int days) {
        Calendar cc = Calendar.getInstance();
        if (startDate != null) {
            cc.setTime(startDate);/*from   www  .  jav  a 2  s  .co m*/
            cc.add(Calendar.DATE, days);
            return cc.getTime();
        } else {
            return null;
        }
    }
}

Related

  1. addDate(String date1, String addpart, int num)
  2. addDate(String dt, long day)
  3. addDateByDays(int days)
  4. addDateDay(int day)
  5. addDateParam(String dtstr, boolean start, List where)
  6. addDay(Date date, int days)
  7. addDays(Date date1, long days)
  8. addDays(Date dateToAdd, int numberOfDay)
  9. addDays(Date target, int days)