Here you can find the source of getFutureDate(long delay, TimeUnit timeUnit)
public static Date getFutureDate(long delay, TimeUnit timeUnit)
//package com.java2s; //License from project: Apache License import java.util.Date; import java.util.concurrent.TimeUnit; public class Main { public static Date getFutureDate(long delay, TimeUnit timeUnit) { if (delay > 0) { return new Date(new Date().getTime() + TimeUnit.MILLISECONDS.convert(delay, timeUnit)); } else {//from w ww .j a va 2s . c o m return new Date(); } } }