Here you can find the source of subtract(Date date, int num)
public static Date subtract(Date date, int num)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date subtract(Date date, int num) { Calendar canlendar = Calendar.getInstance(); canlendar.setTime(date);/*from www .j a v a 2 s .co m*/ canlendar.add(Calendar.DATE, -num); return canlendar.getTime(); } }