Java Date Add addDays(Date date1, long days)

Here you can find the source of addDays(Date date1, long days)

Description

add Days

License

Open Source License

Declaration

public static Date addDays(Date date1, long days) 

Method Source Code

//package com.java2s;

import java.util.*;

public class Main {
    public static long ONE_DAY_SECONDS = 86400;

    public static Date addDays(Date date1, long days) {
        return addSeconds(date1, days * ONE_DAY_SECONDS);
    }//from ww  w.j ava 2s . c o  m

    /**
     * @param date1
     * @param secs
     *
     * @return
     */

    public static Date addSeconds(Date date1, long secs) {
        return new Date(date1.getTime() + (secs * 1000));
    }
}

Related

  1. addDateByDays(int days)
  2. addDateDay(int day)
  3. addDateParam(String dtstr, boolean start, List where)
  4. addDates(Date startDate, int days)
  5. addDay(Date date, int days)
  6. addDays(Date dateToAdd, int numberOfDay)
  7. addDays(Date target, int days)
  8. addDays(Date when, int amount)
  9. addDays(int count, Calendar timestamp)