Here you can find the source of dateIn(long distance, TimeUnit unit)
public static Date dateIn(long distance, TimeUnit unit)
//package com.java2s; //License from project: Apache License import java.util.Date; import java.util.concurrent.TimeUnit; public class Main { public static Date dateIn(long distance, TimeUnit unit) { Date now = new Date(); return new Date(now.getTime() + unit.toMillis(distance)); }/*w w w . ja v a 2 s . c o m*/ }