Here you can find the source of dateAfter(Date origDate, int amount, int timeUnit)
public static final Date dateAfter(Date origDate, int amount, int timeUnit)
//package com.java2s; import java.util.Calendar; import java.util.Date; public class Main { public static final Date dateAfter(Date origDate, int amount, int timeUnit) { Calendar calendar = Calendar.getInstance(); calendar.setTime(origDate);// w w w . j a v a2 s.com calendar.add(timeUnit, amount); return calendar.getTime(); } }