Java SQL Date Create getDateAfter(Date date, Integer after)

Here you can find the source of getDateAfter(Date date, Integer after)

Description

get Date After

License

Apache License

Declaration

public static Date getDateAfter(Date date, Integer after) 

Method Source Code


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

import java.sql.Date;

public class Main {
    public static Date getDateAfter(Date date, Integer after) {
        if (after == 0) {
            return new Date(date.getTime());
        }/*from  ww  w. ja  va 2  s  .c  o m*/
        Date d = new Date(date.getTime());
        for (int i = 0; i < after; i++) {
            d.setTime(d.getTime() + 86400000);
        }
        return d;
    }
}

Related

  1. getCurrentDBDate()
  2. getCurrentSQLDate()
  3. getCurSQLDate()
  4. getCurSQLDateInString(String pstrDateFormat)
  5. getDataMaior(java.sql.Date data1, java.sql.Date data2)
  6. getDateAfter(Date date, long offset)
  7. getDateAsString(int month, int date, int year)
  8. getDateFormat()
  9. getDateFormat(java.util.Date date)