Java Date Add addDate(java.util.Date date, int day)

Here you can find the source of addDate(java.util.Date date, int day)

Description

add Date

License

Apache License

Declaration

public static java.util.Date addDate(java.util.Date date, int day) 

Method Source Code

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

public class Main {

    public static java.util.Date addDate(java.util.Date date, int day) {
        java.util.Calendar c = java.util.Calendar.getInstance();
        c.setTime(date);// www  .  j  a v a 2  s  .  co  m
        c.setTimeInMillis(c.getTimeInMillis() + (long) day * 24 * 3600 * 1000);
        return c.getTime();
    }
}

Related

  1. addDate(Date date, int k)
  2. addDate(Date date, int noOfDays)
  3. addDate(Date date, int years, int months, int days)
  4. addDate(Date date, String unit, int quantity)
  5. addDate(int field, int amount)
  6. addDate(String date)
  7. addDate(String date, int amount)
  8. addDate(String date, String type, int into)
  9. addDate(String date1, String addpart, int num)