Java SQL Date Create getDaysLater(Date date, int days)

Here you can find the source of getDaysLater(Date date, int days)

Description

get Days Later

License

Apache License

Declaration

public static Date getDaysLater(Date date, int days) 

Method Source Code


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

import java.sql.Date;

import java.util.Calendar;

public class Main {
    /**//from  ww  w.j a v a  2  s  . co  m
     * 
    * get date days after date given
    * @param date
    * @param days
    * @return
    * Date  
    * @throws
     */
    public static Date getDaysLater(Date date, int days) {
        Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.add(Calendar.DAY_OF_MONTH, days);
        Date date2 = new Date(calendar.getTimeInMillis());
        return date2;
    }
}

Related

  1. getDay(final java.sql.Date date)
  2. getDay(String stringDate)
  3. getDayByMonthSeed(Date date, int monthSeed)
  4. getDayByWeekString(Date date, String weekString)
  5. getDays(Date from, Date to)
  6. getDayStart(Date stamp)
  7. getLastDateOfQuarter()
  8. getLastDay(Date date)
  9. getLastDay(Date dt)