Java Date Add addDateDay(int day)

Here you can find the source of addDateDay(int day)

Description

add Date Day

License

Apache License

Declaration

public static Date addDateDay(int day) 

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 addDateDay(int day) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, day);
        return calendar.getTime();
    }/*from ww  w  . j  ava  2  s. c  o  m*/

    public static Date addDateDay(Date date, int day) {
        if (null == date) {
            return null;
        }
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(Calendar.DATE, day);
        return calendar.getTime();
    }
}

Related

  1. addDate(String date, int amount)
  2. addDate(String date, String type, int into)
  3. addDate(String date1, String addpart, int num)
  4. addDate(String dt, long day)
  5. addDateByDays(int days)
  6. addDateParam(String dtstr, boolean start, List where)
  7. addDates(Date startDate, int days)
  8. addDay(Date date, int days)
  9. addDays(Date date1, long days)