Java tutorial
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static Date addTimeInterval(Date origin, int value, int unit) { Calendar cal = Calendar.getInstance(); cal.setTime(origin); cal.add(unit, value); return cal.getTime(); } }