Here you can find the source of minus(Date date, int interval, TimeUnit unit)
public static Date minus(Date date, int interval, TimeUnit unit)
//package com.java2s; //License from project: Open Source License import java.util.Date; import java.util.concurrent.TimeUnit; import org.joda.time.DateTime; public class Main { public static Date minus(Date date, int interval, TimeUnit unit) { switch (unit) { case DAYS: return minusDays(date, interval); case HOURS: return minusHours(date, interval); case MINUTES: return minusMinutes(date, interval); case SECONDS: return minusSeconds(date, interval); case MILLISECONDS: return minusMillis(date, interval); default:/*from w w w. j ava 2s. c om*/ break; } return date; } public static Date minusDays(Date date, int days) { return new DateTime(date).minusDays(days).toDate(); } public static Date minusHours(Date date, int hours) { return new DateTime(date).minusHours(hours).toDate(); } public static Date minusMinutes(Date date, int minutes) { return new DateTime(date).minusMinutes(minutes).toDate(); } public static Date minusSeconds(Date date, int seconds) { return new DateTime(date).minusSeconds(seconds).toDate(); } public static Date minusMillis(Date date, int millis) { return new DateTime(date).minusMillis(millis).toDate(); } }