Java Date Add addDaysToCurrentDate(Integer dayIncrement)

Here you can find the source of addDaysToCurrentDate(Integer dayIncrement)

Description

add Days To Current Date

License

Apache License

Declaration

public static Date addDaysToCurrentDate(Integer dayIncrement) 

Method Source Code

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

import java.util.*;

public class Main {
    public static Date addDaysToCurrentDate(Integer dayIncrement) {
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.DATE, dayIncrement);
        return calendar.getTime();
    }/* www  . j a v a 2  s  .  c  o m*/
}

Related

  1. addDays(Date date1, long days)
  2. addDays(Date dateToAdd, int numberOfDay)
  3. addDays(Date target, int days)
  4. addDays(Date when, int amount)
  5. addDays(int count, Calendar timestamp)
  6. addInteger(Date date, int dateType, int amount)
  7. addSeconds(Date date1, long secs)
  8. dateAdd(Date date, int days)
  9. dateAdd(Date date, int days)