Java Date to Time getTime(final Date date, final int day)

Here you can find the source of getTime(final Date date, final int day)

Description

get Time

License

Apache License

Declaration

public static Date getTime(final Date date, final 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 getTime(final int day) {
        return getTime(new Date(), day);
    }/*  w ww  .j  av  a 2 s .com*/

    public static Date getTime(final Date date, final int day) {
        final Calendar calendar = Calendar.getInstance();
        calendar.setTime(date);
        calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) + day);
        return calendar.getTime();
    }
}

Related

  1. getTime(Date date, String pattern, Locale locale)
  2. getTime(Date dateParam)
  3. getTime(Date executionTime)
  4. getTime(Date timestamp)
  5. getTime(Date trialTime)
  6. getTime(final Date time)
  7. getTime(java.util.Date date)
  8. getTime(java.util.Date date)
  9. getTime(java.util.Date date)